aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/configuration
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2021-07-20 10:15:32 +0000
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2021-07-30 11:49:19 +0000
commitc9b3ea89ea31773cdb6ee343dc6ea803d0371739 (patch)
treed6b73bdffaa65452b67a06a64e2e3ebaf136a877 /src/onaptests/configuration
parent7fbd9f67fa43997bc8b030ab24dcc4315493c1b1 (diff)
CDS resource-resolution test
Issue-ID: TEST-291 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Change-Id: I441f2486b38481624eeefa18f47840d4c7a3db9d
Diffstat (limited to 'src/onaptests/configuration')
-rw-r--r--src/onaptests/configuration/cds_resource_resolution_settings.py77
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"
+ }
+ }
+}