aboutsummaryrefslogtreecommitdiffstats
path: root/src/onaptests/configuration/cds_resource_resolution_settings.py
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-09-02 13:10:42 +0000
commitc31b7fb464fbb8bb0c7d8d2b3dc7b20f4a04cff5 (patch)
tree20bf589edfc6cc5511f8417395234fbd60bad638 /src/onaptests/configuration/cds_resource_resolution_settings.py
parentfd8334dd51d63df817a2057cb3298c125cf310b9 (diff)
[TEST] CDS resource-resolution test
Issue-ID: TEST-291 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Change-Id: I5d9f55b67942c62f63e11282ef2383fe063d3137
Diffstat (limited to 'src/onaptests/configuration/cds_resource_resolution_settings.py')
-rw-r--r--src/onaptests/configuration/cds_resource_resolution_settings.py79
1 files changed, 79 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..bb3b85b
--- /dev/null
+++ b/src/onaptests/configuration/cds_resource_resolution_settings.py
@@ -0,0 +1,79 @@
+from pathlib import Path
+from uuid import uuid4
+
+from .settings import * # pylint: disable=W0614
+
+CLEANUP_FLAG = True
+SERVICE_NAME = "CDS resource resolution"
+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"
+ }
+ }
+}