diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2021-08-19 13:12:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-08-19 13:12:03 +0000 |
commit | 017e97ccae99714c2f4c0a50ddedd5ab1e5585a9 (patch) | |
tree | cf90655fa9d4481ea6517d380ac901a81fbd0074 /src/onaptests/configuration | |
parent | 0c9f5a021a6f4704e5c09a2db70160cd1d7e074d (diff) | |
parent | c9b3ea89ea31773cdb6ee343dc6ea803d0371739 (diff) |
Merge "CDS resource-resolution test"
Diffstat (limited to 'src/onaptests/configuration')
-rw-r--r-- | src/onaptests/configuration/cds_resource_resolution_settings.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/onaptests/configuration/cds_resource_resolution_settings.py b/src/onaptests/configuration/cds_resource_resolution_settings.py new file mode 100644 index 0000000..c7687b5 --- /dev/null +++ b/src/onaptests/configuration/cds_resource_resolution_settings.py @@ -0,0 +1,77 @@ +from pathlib import Path +from uuid import uuid4 + +from .settings import * # pylint: disable=W0614 + +CLOUD_REGION_CLOUD_OWNER = "basicnf-owner" # must not contain _ +CLOUD_REGION_ID = "k8sregion" +CLOUD_REGION_TYPE = "k8s" +CLOUD_REGION_VERSION = "1.0" +CLOUD_OWNER_DEFINED_TYPE = "N/A" +COMPLEX_PHYSICAL_LOCATION_ID = "sdktests" + +PNF_DEFINITION_ATRIFACT_FILE_PATH = Path(Path(__file__).parent.parent, + "templates/artifacts/cds-resource-resolution/cds-mock-server.tar.gz") +PNF_RB_NAME = f"cds-ms-rb-{str(uuid4())}" +PNF_RB_VERSION = "v1" +PNF_PROFILE_ARTIFACT_FILE_PATH = Path(Path(__file__).parent.parent, + "templates/artifacts/profile.tar.gz") +PNF_PROFILE_NAME = f"cds-ms-prof-{str(uuid4())}" +K8S_VERSION = "1.0" +K8S_CONFIG = str(Path(Path(__file__).parent.parent, "templates/artifacts/config")) +CDS_MOCKSERVER_EXPECTATIONS = [ + { + "method": "GET", + "path": "/resource-resolution/get", + "response": '{"value": "A046E51D-44DC-43AE-BBA2-86FCA86C5265"}' + }, + { + "method": "GET", + "path": "/resource-resolution/get/A046E51D-44DC-43AE-BBA2-86FCA86C5265/id", + "response": '{"value": "74FE67C6-50F5-4557-B717-030D79903908"}' + }, + { + "method": "POST", + "path": "/resource-resolution/post", + "response": '{"value": "post:ok"}' + }, + { + "method": "PUT", + "path": "/resource-resolution/put", + "response": '{"value": "put:ok"}' + }, + { + "method": "PATCH", + "path": "/resource-resolution/patch", + "response": '{"value": "patch:ok"}' + }, + { + "method": "DELETE", + "path": "/resource-resolution/delete", + "response": '{"value": "delete:ok"}' + } +] + +CDS_DD_FILE = Path(Path(__file__).parent.parent, "templates/artifacts/cds-resource-resolution/dd.json") +CDS_CBA_UNENRICHED = Path(Path(__file__).parent.parent, "templates/artifacts/cds-resource-resolution/resource-resolution.zip") +CDS_CBA_ENRICHED = "/tmp/resource-resolution-enriched.zip" +CDS_WORKFLOW_NAME = "resource-resolution" +CDS_WORKFLOW_INPUT = { + "template-prefix": [ + "helloworld-velocity", + "helloworld-jinja" + ], + "resolution-key": "regression-test", + "resource-resolution-properties": { + "v_input": "ok", + "j_input": "ok" + } +} +CDS_WORKFLOW_EXPECTED_OUTPUT = { + "resource-resolution-response": { + "meshed-template": { + "helloworld-velocity": "{\n \"default\": \"ok\",\n \"input\": \"ok\",\n \"script\": {\n \"python\": \"ok\",\n \"kotlin\": \"ok\"\n },\n \"db\": \"ok\",\n \"rest\": {\n \"GET\": \"A046E51D-44DC-43AE-BBA2-86FCA86C5265\",\n \"POST\": \"post:ok\",\n \"PUT\": \"put:ok\",\n \"PATCH\": \"patch:ok\",\n \"DELETE\": \"delete:ok\"\n }\n}\n", + "helloworld-jinja": "{\n \"default\": \"ok\",\n \"input\": \"ok\",\n \"script\": {\n \"python\": \"ok\",\n \"kotlin\": {\n \"base\": \"ok\"\n \"from suspend function\": \"ok\"\n }\n },\n \"db\": \"ok\",\n \"rest\": {\n \"GET\": \"A046E51D-44DC-43AE-BBA2-86FCA86C5265\",\n \"GET_ID\": \"74FE67C6-50F5-4557-B717-030D79903908\",\n \"POST\": \"post:ok\",\n \"PUT\": \"put:ok\",\n \"PATCH\": \"patch:ok\",\n \"DELETE\": \"delete:ok\"\n }\n}\n" + } + } +} |