Added CSIT for Macroflow with HELM 11/121511/3
authorMD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Sat, 22 May 2021 17:15:54 +0000 (22:45 +0530)
committerMD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Mon, 31 May 2021 14:39:45 +0000 (20:09 +0530)
Issue-ID: SO-3585

Signed-off-by: MD IRSHAD SHEIKH <md.irshad.sheikh@huawei.com>
Change-Id: I3eb3ec1005f19fc109e28b1e709bdc0d32f1180a

13 files changed:
plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/java/org/onap/so/multicloudsimulator/controller/MultiCloudController.java
plans/so/integration-etsi-testing/so-simulators/multicloud-simulator/src/main/resources/application.yaml
plans/so/macroflow/config/distribution-test-zip/macro_helm_zipped_sdc_csar.tar.gz [new file with mode: 0755]
plans/so/macroflow/config/env
plans/so/macroflow/config/override-files/cnf-adapter/onapheat/override.yaml [new file with mode: 0644]
plans/so/macroflow/config/override-files/openstack-adapter/onapheat/override.yaml
plans/so/macroflow/docker-compose.local.yml
plans/so/macroflow/docker-compose.yml
plans/so/macroflow/testplan.txt
tests/so/sanity-check/data/MacroflowWithHelm.json [new file with mode: 0644]
tests/so/sanity-check/data/serviceBasicVfCnfWithHelm.json [new file with mode: 0644]
tests/so/sanity-check/macroflow.robot
tests/so/sanity-check/macroflow_helm.robot [new file with mode: 0644]

index c99e246..8361f24 100644 (file)
@@ -30,14 +30,13 @@ import org.onap.so.multicloudsimulator.beans.MulticloudRequest;
 import org.springframework.http.ResponseEntity;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestHeader;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.GetMapping;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -45,22 +44,22 @@ import java.io.InputStream;
 import static org.onap.so.multicloudsimulator.utils.Constants.BASE_URL;
 
 @RestController
-@RequestMapping(path = BASE_URL)
 public class MultiCloudController {
 
     public static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override";
     private static final Logger LOGGER = LoggerFactory.getLogger(MultiCloudController.class);
 
-    @PostMapping(value = "/v1/instance")
+    @PostMapping("/v1/instance")
     public ResponseEntity<?> createInstance(@RequestBody MulticloudInstanceRequest req) {
-        System.out.println("MultiCloud createInstance ");
+        LOGGER.info("MultiCloud createInstance ");
         final InstanceResponse InstanceResponse = new InstanceResponse();
 
-        LOGGER.info("Calling createInstance");
-        return ResponseEntity.ok(InstanceResponse);
+        LOGGER.info("Calling v1 instance method");
+        return ResponseEntity.ok(req);
     }
 
-    @GetMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload", produces = { MediaType.APPLICATION_JSON })
+    @GetMapping(value = BASE_URL + "/{cloud-owner}/{cloud-region-id}/infra_workload",
+            produces = { MediaType.APPLICATION_JSON })
     public ResponseEntity<?> getInstance(@PathVariable("cloud-owner") String cloudOwner,
             @PathVariable("cloud-region-id") String cloudRegionId,
             @RequestParam(value = "depth", required = false, defaultValue = "0") Integer depth,
@@ -76,8 +75,9 @@ public class MultiCloudController {
         return ResponseEntity.ok(output);
     }
 
-    @PostMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload", consumes = { MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML }, produces = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @PostMapping(value = BASE_URL +  "/{cloud-owner}/{cloud-region-id}/infra_workload",
+            consumes = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML },
+            produces = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     public ResponseEntity<?> postCreateInstance(@RequestBody final MulticloudCreateResponse inputRequest,
             @PathVariable("cloud-owner") final String cloudOwner,
             @PathVariable("cloud-region-id") final String cloudRegionId,
@@ -94,8 +94,8 @@ public class MultiCloudController {
         return ResponseEntity.status(201).body(inputRequest);
     }
 
-    @GetMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}", produces = {
-            MediaType.APPLICATION_JSON })
+    @GetMapping(value = BASE_URL +  "/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}",
+            produces = {MediaType.APPLICATION_JSON })
     public ResponseEntity<?> getInstanceName(@PathVariable("cloud-owner") final String cloudOwner,
             @PathVariable("cloud-region-id") final String cloudRegionId, @PathVariable("workload-id") final String workloadId,
             @RequestParam(value = "depth", required = false, defaultValue = "0") final Integer depth,
@@ -112,9 +112,9 @@ public class MultiCloudController {
         return ResponseEntity.ok(output);
     }
 
-    @PostMapping(value = "/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}", consumes = {
-            MediaType.APPLICATION_JSON,
-            MediaType.APPLICATION_XML }, produces = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
+    @PostMapping(value = BASE_URL +  "/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}",
+            consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML },
+            produces = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     public ResponseEntity<?> postCreateInstanceName(@RequestBody final MulticloudRequest inputRequest,
             @PathVariable("cloud-owner") final String cloudOwner, @PathVariable("workload-id") String workloadId,
             @PathVariable("cloud-region-id") final String cloudRegionId,
diff --git a/plans/so/macroflow/config/distribution-test-zip/macro_helm_zipped_sdc_csar.tar.gz b/plans/so/macroflow/config/distribution-test-zip/macro_helm_zipped_sdc_csar.tar.gz
new file mode 100755 (executable)
index 0000000..c06f490
Binary files /dev/null and b/plans/so/macroflow/config/distribution-test-zip/macro_helm_zipped_sdc_csar.tar.gz differ
index f5453e9..86a8827 100644 (file)
@@ -4,4 +4,5 @@ TAG=1.8.0-STAGING-latest
 TIME_OUT_DEFAULT_VALUE_SEC=1200
 PROJECT_NAME=macroflowintegrationtesting
 DEFAULT_NETWORK_NAME=macroflowintegrationtesting_default
+CNF_ADAPTER_IMAGE_VERSION=1.8.2
 MARIADB_VERSION=10.5.8
diff --git a/plans/so/macroflow/config/override-files/cnf-adapter/onapheat/override.yaml b/plans/so/macroflow/config/override-files/cnf-adapter/onapheat/override.yaml
new file mode 100644 (file)
index 0000000..2742583
--- /dev/null
@@ -0,0 +1,56 @@
+# Copyright 2020 Huawei Technologies Co., Ltd.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+logging:
+  path: logs
+
+server:
+    port: 8090
+    tomcat:
+        max-threads: 50
+
+mso:
+  auth: BEA8637716A7EB617DF472BA6552D22F68C1CB17B0D094D77DDA562F4ADAAC4457CAB848E1A4
+  msoKey: 07a7159d3bf51a0e53be7a8f89699be7
+  logPath: ./logs/cnf
+  msb-ip: multicloud-k8s
+  msb-port: 9015
+  msb-scheme: http
+spring:
+  security:
+    usercredentials:
+    -
+      username: apihBpmn
+      password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+      role: BPMN-Client
+    -
+      username: sdncaBpmn
+      password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+      role: BPMN-Client
+    -
+      username: poBpmn
+      password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+      role: BPMN-Client
+    -
+      username: wmaBpmn
+      password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+      role: BPMN-Client
+    -
+      username: sniro
+      password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+      role: SNIRO-Client
+    -
+      username: mso_admin
+      password: '$2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke'
+      role: ACTUATOR
index 7e2afa8..1b5e996 100644 (file)
@@ -93,8 +93,8 @@ mso:
   auth: BEA8637716A7EB617DF472BA6552D22F68C1CB17B0D094D77DDA562F4ADAAC4457CAB848E1A4
   msoKey: 07a7159d3bf51a0e53be7a8f89699be7
   logPath: ./logs/openstack
-  msb-ip: multicloud-simulator
-  msb-port: 9996
+  msb-ip: multicloud-k8s
+  msb-port: 9015
   msb-scheme: http
   workflow:
     endpoint: http://bpmn-infra:8081/sobpmnengine
index a796b37..34a5419 100644 (file)
@@ -15,6 +15,9 @@ services:
 ################################################################################
   openstack-adapter:
     image: onap/so/openstack-adapter:${TAG}
+################################################################################
+  so-cnf-adapter:
+    image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-cnf-adapter:${TAG}
 ################################################################################
   sdc-controller:
     image: onap/so/sdc-controller:${TAG}
index 5b6bfb2..1bd3fb1 100644 (file)
@@ -135,6 +135,36 @@ services:
     user: root
     entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"'
 ################################################################################
+  so-cnf-adapter:
+    image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-cnf-adapter:${CNF_ADAPTER_IMAGE_VERSION}
+    ports:
+      - "8090:8090"
+    volumes:
+      - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates
+      - ${CONFIG_DIR_PATH_MACRO}/override-files/cnf-adapter/onapheat:/app/config
+    environment:
+      - APP=so-cnf-adapter
+      - JVM_ARGS=-Xms64m -Xmx512m
+      - DB_HOST=mariadb
+      - DB_PORT=3306
+      - DB_USERNAME=so_user
+      - DB_PASSWORD=so_User123
+      - DB_ADMIN_USERNAME=so_admin
+      - DB_ADMIN_PASSWORD=so_Admin123
+    hostname:
+      so-cnf-adapter.so.testlab.onap.org
+    depends_on:
+      - mariadb
+      - catalog-db-adapter
+      - request-db-adapter
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "30m"
+        max-file: "5"
+    user: root
+    entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"'
+####################################################################################
   sdc-controller:
     image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/sdc-controller:${TAG}
     ports:
@@ -164,7 +194,7 @@ services:
         max-size: "30m"
         max-file: "5"
     user: root
-    entrypoint: /bin/sh -c 'mkdir -p /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/macro_zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && chmod 777 -R /distribution-test-zip/ && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"'
+    entrypoint: /bin/sh -c 'mkdir -p /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/macro_zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && tar -xvzf /distribution-test-zip/macro_helm_zipped_sdc_csar.tar.gz -C /distribution-test-zip/unzipped && chmod 777 -R /distribution-test-zip/ && /app/wait-for.sh -q -t "300" request-db-adapter:8083 -- "/app/start-app.sh"'
 ################################################################################
   bpmn-infra:
     image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/bpmn-infra:${TAG}
@@ -294,17 +324,17 @@ services:
         max-size: "30m"
         max-file: "5"
 #################################################################################
-  multicloud-simulator:
+  multicloud-k8s:
     image: simulators/multicloud-simulator:latest
     ports:
-    - "9996:9996"
+      - "9015:9015"
     environment:
-    - APP=MULTICLOUD-SIMULATOR
+    - APP=multicloud-k8s
     - JVM_ARGS=-Xms64m -Xmx512m
     hostname:
-      multicloud-simulator
+      multicloud-k8s
     depends_on:
-    - mariadb    
+    - mariadb
     logging:
       driver: "json-file"
       options:
index 00a8d8b..3e4ff10 100644 (file)
@@ -1,3 +1,4 @@
 # Test suites are relative paths under [integration/csit.git]/tests/.
 # Place the suites in run order.
 so/sanity-check/macroflow.robot
+so/sanity-check/macroflow_helm.robot
diff --git a/tests/so/sanity-check/data/MacroflowWithHelm.json b/tests/so/sanity-check/data/MacroflowWithHelm.json
new file mode 100644 (file)
index 0000000..bea4ad9
--- /dev/null
@@ -0,0 +1,183 @@
+{
+            "requestDetails": {
+               "modelInfo": {
+                  "modelInvariantId": "12f78123-0fe3-4691-8621-152b1aeb740b",
+                  "modelType": "service",
+                  "modelName": "vfw_k8s_demo_CNF_e2e_native_2",
+                  "modelVersion": "1.0",
+                  "modelVersionId": "623d4032-89ec-4f14-a655-31943fb002fa",
+                  "modelUuid": "623d4032-89ec-4f14-a655-31943fb002fa",
+                  "modelInvariantUuid": "12f78123-0fe3-4691-8621-152b1aeb740b"
+               },
+               "requestInfo": {
+                  "productFamilyId": "1234",
+                  "source": "VID",
+                  "instanceName": "INSTANCE_vfw_k8s_demo_CNF_e2e_native_2",
+                  "suppressRollback": false,
+                  "requestorId": "demo"
+               },
+               "subscriberInfo": {
+                  "globalSubscriberId": "DemoCustomer"
+               },
+               "cloudConfiguration": {
+                  "tenantId": "693c7729b2364a26a3ca602e6f66187d",
+                  "cloudOwner": "CloudOwner",
+                  "lcpCloudRegionId": "EtsiCloudRegion"
+               },
+               "requestParameters": {
+                  "subscriptionServiceType": "vCPE",
+                  "userParams": [
+                     {
+                        "Homing_Solution": "none"
+                     },
+                     {
+                        "service": {
+                           "instanceParams": [],
+                           "instanceName": "INSTANCE_vfw_k8s_demo_CNF_e2e_native_2",
+                           "resources": {
+                              "vnfs": [
+                                 {
+                                    "modelInfo": {
+                                       "modelName": "VF_vfw_k8s_demo_CNF_e2e_native_2",
+                                       "modelVersionId": "9b6c36da-e4bb-4d58-b22e-5f0198a1813e",
+                                       "modelInvariantUuid": "d65aeed1-1980-44dd-bdeb-ee78ea5ab842",
+                                       "modelVersion": "1.0",
+                                       "modelCustomizationId": "28aeaced-a71c-48ce-a3ae-58ab9eb4dd9f",
+                                       "modelInstanceName": "VF_vfw_k8s_demo_CNF_e2e_native_2"
+                                    },
+                                    "cloudConfiguration": {
+                                       "tenantId": "693c7729b2364a26a3ca602e6f66187d",
+                                       "cloudOwner": "CloudOwner",
+                                       "lcpCloudRegionId": "EtsiCloudRegion"
+                                    },
+                                    "platform": {
+                                       "platformName": "test"
+                                    },
+                                    "lineOfBusiness": {
+                                       "lineOfBusinessName": "LOB-Demonstration"
+                                    },
+                                    "productFamilyId": "1234",
+                                    "instanceName": "VF_vfw_k8s_demo_CNF_e2e_native_2",
+                                    "instanceParams": [
+                                       {
+                                          "sdnc_model_name": "vFW_CNF_CDS",
+                                          "sdnc_model_version": "7.1.0",
+                                          "sdnc_artifact_name": "vnf"
+                                       }
+                                    ],
+                                    "vfModules": [
+                                       {
+                                          "modelInfo": {
+                                             "modelName": "VfVfwK8sDemoCnfE2eNative2..helm_vpkg..module-2",
+                                             "modelVersionId": "b3e97d36-8e10-411f-a682-8551844e04ea",
+                                             "modelInvariantUuid": "f753b92d-2a70-488d-b53a-300435d6a455",
+                                             "modelVersion": "1",
+                                             "modelCustomizationId": "30ce403e-99cc-43c2-8782-15499895d157"
+                                          },
+                                          "instanceName": "vf_vfw_k8s_demo_cnf_e2e_native_20..VfVfwK8sDemoCnfE2eNative2..helm_vpkg..module-2",
+                                          "instanceParams": [
+                                             {
+                                                "k8s-rb-profile-name": "vfw-cnf-cds-base-profile",
+                                                "k8s-rb-profile-namespace": "vfirewall",
+                                                "sdnc_model_name": "vFW_CNF_CDS",
+                                                "sdnc_model_version": "7.1.0",
+                                                "vf_module_label": "helm_vpkg"
+                                             }
+                                          ]
+                                       },
+                                       {
+                                          "modelInfo": {
+                                             "modelName": "VfVfwK8sDemoCnfE2eNative2..helm_base_template..module-4",
+                                             "modelVersionId": "bb944b26-d331-4e01-9e1a-47355b162bc8",
+                                             "modelInvariantUuid": "12ac8bc6-330a-4071-a34b-65aab99539ec",
+                                             "modelVersion": "1",
+                                             "modelCustomizationId": "95db0408-b8df-44fb-8199-37394c1085d8"
+                                          },
+                                          "instanceName": "vf_vfw_k8s_demo_cnf_e2e_native_20..VfVfwK8sDemoCnfE2eNative2..helm_base_template..module-4",
+                                          "instanceParams": [
+                                             {
+                                                "k8s-rb-profile-name": "vfw-cnf-cds-base-profile",
+                                                "k8s-rb-profile-namespace": "vfirewall",
+                                                "sdnc_model_name": "vFW_CNF_CDS",
+                                                "sdnc_model_version": "7.1.0",
+                                                "vf_module_label": "helm_base_template"
+                                             }
+                                          ]
+                                       },
+                                       {
+                                          "modelInfo": {
+                                             "modelName": "VfVfwK8sDemoCnfE2eNative2..helm_vfw..module-3",
+                                             "modelVersionId": "79cfcc33-1456-438b-b362-a2a8587a80f8",
+                                             "modelInvariantUuid": "e46c710f-ad4b-49a5-bbae-4e0f16fc4a98",
+                                             "modelVersion": "1",
+                                             "modelCustomizationId": "b87081da-c8e0-4c20-aefa-2da23c998502"
+                                          },
+                                          "instanceName": "vf_vfw_k8s_demo_cnf_e2e_native_20..VfVfwK8sDemoCnfE2eNative2..helm_vfw..module-3",
+                                          "instanceParams": [
+                                             {
+                                                "k8s-rb-profile-name": "vfw-cnf-cds-base-profile",
+                                                "k8s-rb-profile-namespace": "vfirewall",
+                                                "sdnc_model_name": "vFW_CNF_CDS",
+                                                "sdnc_model_version": "7.1.0",
+                                                "vf_module_label": "helm_vfw"
+                                             }
+                                          ]
+                                       },
+                                       {
+                                          "modelInfo": {
+                                             "modelName": "VfVfwK8sDemoCnfE2eNative2..helm_vsn..module-1",
+                                             "modelVersionId": "efa8355e-d011-4f90-b17a-3542d2cf8321",
+                                             "modelInvariantUuid": "502a434b-f718-4332-a8d2-2e689f8ceb22",
+                                             "modelVersion": "1",
+                                             "modelCustomizationId": "0dc8a6d0-fe90-4f77-bf2a-4dcd4b82f548"
+                                          },
+                                          "instanceName": "vf_vfw_k8s_demo_cnf_e2e_native_20..VfVfwK8sDemoCnfE2eNative2..helm_vsn..module-1",
+                                          "instanceParams": [
+                                             {
+                                                "k8s-rb-profile-name": "vfw-cnf-cds-base-profile",
+                                                "k8s-rb-profile-namespace": "vfirewall",
+                                                "sdnc_model_name": "vFW_CNF_CDS",
+                                                "sdnc_model_version": "7.1.0",
+                                                "vf_module_label": "helm_vsn"
+                                             }
+                                          ]
+                                       },
+                                       {
+                                          "modelInfo": {
+                                             "modelName": "VfVfwK8sDemoCnfE2eNative2..base_template_dummy_ignore..module-0",
+                                             "modelVersionId": "67b3b9a9-23cf-4212-a482-3fb5d9521247",
+                                             "modelInvariantUuid": "f7b40081-9ddc-4885-a409-5f57685c4a46",
+                                             "modelVersion": "1",
+                                             "modelCustomizationId": "c25ecd21-31a6-4a9d-8bc1-945570f7d2aa"
+                                          },
+                                          "instanceName": "vf_vfw_k8s_demo_cnf_e2e_native_20..VfVfwK8sDemoCnfE2eNative2..base_template_dummy_ignore..module-0",
+                                          "instanceParams": [
+                                             {}
+                                          ]
+                                       }
+                                    ]
+                                 }
+                              ]
+                           },
+                           "modelInfo": {
+                              "modelVersion": "1.0",
+                              "modelVersionId": "623d4032-89ec-4f14-a655-31943fb002fa",
+                              "modelInvariantId": "12f78123-0fe3-4691-8621-152b1aeb740b",
+                              "modelName": "vfw_k8s_demo_CNF_e2e_native_2",
+                              "modelType": "service"
+                           }
+                        }
+                     }
+                  ],
+                  "aLaCarte": false,
+                  "usePreload": false
+               },
+               "project": {
+                  "projectName": "etsiCsitProject"
+               },
+               "owningEntity": {
+                  "owningEntityId": "f2e1071e-3d47-4a65-94d4-e473ec03326a",
+                  "owningEntityName": "OE-Demonstration"
+               }
+            }
+         }
diff --git a/tests/so/sanity-check/data/serviceBasicVfCnfWithHelm.json b/tests/so/sanity-check/data/serviceBasicVfCnfWithHelm.json
new file mode 100644 (file)
index 0000000..c1775f9
--- /dev/null
@@ -0,0 +1,170 @@
+{
+  "distributionID": "538da916-d1fc-4616-81d3-a4ccc07b5ee3",
+  "serviceName": "vfw_k8s_demo_CNF_e2e_native_2",
+  "serviceVersion": "1.0",
+  "serviceUUID": "623d4032-89ec-4f14-a655-31943fb002fa",
+  "serviceDescription": "service",
+  "serviceInvariantUUID": "12f78123-0fe3-4691-8621-152b1aeb740b",
+  "resources": [
+    {
+      "resourceInstanceName": "VF_vfw_k8s_demo_CNF_e2e_native_2",
+      "resourceName": "VF_vfw_k8s_demo_CNF_e2e_native_2",
+      "resourceVersion": "1.0",
+      "resoucreType": "VF",
+      "resourceUUID": "9b6c36da-e4bb-4d58-b22e-5f0198a1813e",
+      "resourceInvariantUUID": "d65aeed1-1980-44dd-bdeb-ee78ea5ab842",
+      "resourceCustomizationUUID": "28aeaced-a71c-48ce-a3ae-58ab9eb4dd9f",
+      "category": "Generic",
+      "subcategory": "Abstract",
+      "artifacts": [{
+          "artifactName": "vf_vfw_k8s_demo_cnf_e2e_native_20_modules.json",
+          "artifactType": "VF_MODULES_METADATA",
+          "artifactURL": "/unzipped_sdc_csar/vf_vfw_k8s_demo_cnf_e2e_native_20_modules.json",
+          "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI\u003d",
+          "artifactDescription": "Auto-generated VF Modules information artifact",
+          "artifactTimeout": 120,
+          "artifactUUID": "86224a10-c17e-42c9-9809-f3c31ba1b781",
+          "artifactVersion": "1"
+        }, 
+        {
+          "artifactName": "helm_base_template.env",
+          "artifactType": "HEAT_ENV",
+          "artifactURL": "/unzipped_sdc_csar/helm_base_template.env",
+          "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI\u003d",
+          "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+          "artifactTimeout": 0,
+          "artifactVersion": "2",
+          "artifactUUID": "368f90d2-2b5e-4987-a35a-248b77d7aa0a",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "helm_vfw.env",
+          "artifactType": "HEAT_ENV",
+          "artifactURL": "/unzipped_sdc_csar/helm_vfw.env",
+          "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI\u003d",
+          "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+          "artifactTimeout": 0,
+          "artifactVersion": "2",
+          "artifactUUID": "47cdc1c7-07b6-4121-b49c-521658ac7f9a",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "helm_vpkg.env",
+          "artifactType": "HEAT_ENV",
+          "artifactURL": "/unzipped_sdc_csar/helm_vpkg.env",
+          "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI\u003d",
+          "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+          "artifactTimeout": 0,
+          "artifactVersion": "2",
+          "artifactUUID": "da36f872-ce07-4f1f-95e5-5d9f836b2fb4",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "base_template_dummy_ignore.yaml",
+          "artifactType": "HEAT",
+          "artifactURL": "/unzipped_sdc_csar/base_template_dummy_ignore.yaml",
+          "artifactChecksum": "ZjI3NTdkZWViNTEzY2NhZjg4MmQ3OTcxZjcyMmNmNDY\u003d",
+          "artifactDescription": "created from csar",
+          "artifactTimeout": 30,
+          "artifactVersion": "1",
+          "artifactUUID": "54f0f7f4-600d-473a-869f-bd86a3a57d52",
+          "generatedArtifact": {
+            "artifactName": "base_template_dummy_ignore.env",
+            "artifactType": "HEAT_ENV",
+            "artifactURL": "/unzipped_sdc_csar/base_template_dummy_ignore.env",
+            "artifactChecksum": "MTFhYjczYTdlMDU5MmE4N2FlMzhkM2RmMjIxZmY4ZmM\u003d",
+            "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+            "artifactTimeout": 0,
+            "artifactVersion": "2",
+            "artifactUUID": "098499f4-aad8-4398-b02b-ae9f18cc2770",
+            "generatedFromUUID": "54f0f7f4-600d-473a-869f-bd86a3a57d52"
+          },
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "helm_vsn.env",
+          "artifactType": "HEAT_ENV",
+          "artifactURL": "/unzipped_sdc_csar/helm_vsn.env",
+          "artifactChecksum": "MTA2MjAxNDAyMmY0NmMwYTlmMDMyN2FjZDUxODkzNWI\u003d",
+          "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+          "artifactTimeout": 0,
+          "artifactVersion": "2",
+          "artifactUUID": "756c8891-9120-42b2-948f-4831c248b5a3",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "helm_base_template.tgz",
+          "artifactType": "HELM",
+          "artifactURL": "/unzipped_sdc_csar/helm_base_template.tgz",
+          "artifactChecksum": "YmVkODgxMzUzMzJlZmYzNzg0ZDViMjNlYmJiMmVlZmY\u003d",
+          "artifactDescription": "created from csar",
+          "artifactTimeout": 30,
+          "artifactVersion": "1",
+          "artifactUUID": "4affda27-3aac-4d12-bc09-d7539cafc122",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "base_template_dummy_ignore.env",
+          "artifactType": "HEAT_ENV",
+          "artifactURL": "/unzipped_sdc_csar/base_template_dummy_ignore.env",
+          "artifactChecksum": "MTFhYjczYTdlMDU5MmE4N2FlMzhkM2RmMjIxZmY4ZmM\u003d",
+          "artifactDescription": "Auto-generated HEAT Environment deployment artifact",
+          "artifactTimeout": 0,
+          "artifactVersion": "2",
+          "artifactUUID": "098499f4-aad8-4398-b02b-ae9f18cc2770",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "helm_vsn.tgz",
+          "artifactType": "HELM",
+          "artifactURL": "/unzipped_sdc_csar/helm_vsn.tgz",
+          "artifactChecksum": "NmJmODE3NzY5YWRjNDYxZjI4ZGYyZjU1ZDY3ZDJkMWE\u003d",
+          "artifactDescription": "created from csar",
+          "artifactTimeout": 30,
+          "artifactVersion": "1",
+          "artifactUUID": "c9e8dce1-43f0-4100-973c-0eb576b3270c",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "helm_vfw.tgz",
+          "artifactType": "HELM",
+          "artifactURL": "/unzipped_sdc_csar/helm_vfw.tgz",
+          "artifactChecksum": "MGNhNjAxYjNkOTUyYzBiOTJjNzIzMWVjN2FkZTg3ZWU\u003d",
+          "artifactDescription": "created from csar",
+          "artifactTimeout": 30,
+          "artifactVersion": "1",
+          "artifactUUID": "6d46bee9-d724-4332-b6e8-3133af774b6b",
+          "relatedArtifactsInfo": []
+        },
+        {
+          "artifactName": "helm_vpkg.tgz",
+          "artifactType": "HELM",
+          "artifactURL": "/unzipped_sdc_csar/helm_vpkg.tgz",
+          "artifactChecksum": "NjQ0MDA1OTI5Nzk1NjJmZGJjYjZlZTk0MzY1NjhmZjk\u003d",
+          "artifactDescription": "created from csar",
+          "artifactTimeout": 30,
+          "artifactVersion": "1",
+          "artifactUUID": "dfc44bf0-ffec-4b70-9226-da4ca7801f79",
+          "relatedArtifactsInfo": []
+        }
+
+]
+    }
+   
+   
+  ],
+  "serviceArtifacts": [
+    {
+      "artifactName": "service-VfwK8sDemoCnfE2eNative2-csar.csar",
+      "artifactType": "TOSCA_CSAR",
+      "artifactURL": "/unzipped_sdc_csar/service-VfwK8sDemoCnfE2eNative2-csar.csar",
+      "artifactChecksum": "ZTRhOGI0M2UxN2ZhYjQ0ODI5ZDZhZTExZTFkMGU3N2Y\u003d",
+      "artifactDescription": "TOSCA definition package of the asset",
+      "artifactTimeout": 0,
+      "artifactUUID": "623d4032-89ec-4f14-a655-31943fb002fa",
+      "artifactVersion": "1"
+    }
+  ],
+  "workloadContext": "Production"
+}
+
index cd3a5b5..53424d0 100644 (file)
@@ -5,16 +5,16 @@ Library     OperatingSystem
 Library     json
 
 *** Variables ***
-${SLEEP_INTERVAL_SEC}=   60
+${SLEEP_INTERVAL_SEC}=   30
+${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}=     48     # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry.
 
 *** Test Cases ***
 Distribute Service Template
     Create Session   sdc_controller_session  http://${REPO_IP}:8085
     ${data}=    Get Binary File     ${CURDIR}${/}data${/}serviceBasicVfCnfnotification.json
     &{headers}=  Create Dictionary    Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ=    resource-location=/distribution-test-zip/unzipped/    Content-Type=application/json    Accept=application/json
-    ${resp}=    Post Request    sdc_controller_session    /test/treatNotification/v1    data=${data}    headers=${headers}
+    ${resp}=    POST On Session    sdc_controller_session    /test/treatNotification/v1    data=${data}    headers=${headers}
     Log To Console     Received status code: ${resp.status_code}
-    Run Keyword If  '${resp.status_code}' == '200'  log to console  \nexecuted with expected result
     Should Be Equal As Strings    '${resp.status_code}'    '200'
 
 
@@ -22,8 +22,24 @@ Macroflow
     Create Session   api_handler_session  http://${REPO_IP}:8080
     ${data}=    Get Binary File     ${CURDIR}${/}data${/}macroflow.json
     &{headers}=  Create Dictionary    Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Content-Type=application/json    Accept=application/json
-    ${service_instantiation_request}=    Post Request    api_handler_session    /onap/so/infra/serviceInstantiation/v7/serviceInstances    data=${data}    headers=${headers}
+    ${service_instantiation_request}=    POST On Session    api_handler_session    /onap/so/infra/serviceInstantiation/v7/serviceInstances    data=${data}    headers=${headers}
     Log To Console     Received status code: ${service_instantiation_request.status_code}
-    Run Keyword If  '${service_instantiation_request.status_code}' == '202'  log to console   \nexecuted with expected result
-    Should Be Equal As Strings    '${service_instantiation_request.status_code}'    '202'
-    SLEEP   ${SLEEP_INTERVAL_SEC}s
+    ${service_instantiation_json_response}=    Evaluate     json.loads(r"""${service_instantiation_request.content}""", strict=False)    json
+    ${request_ID}=          Set Variable         ${service_instantiation_json_response}[requestReferences][requestId]
+    ${actual_request_state}=    Set Variable    ""
+
+    FOR    ${INDEX}    IN RANGE    ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+       ${orchestration_status_request}=   Get On Session  api_handler_session   /onap/so/infra/orchestrationRequests/v7/${request_ID}
+       Run Keyword If  '${orchestration_status_request.status_code}' == '200'  log to console   \nexecuted with expected result
+       log to console      ${orchestration_status_request.content}
+       ${orchestration_json_response}=    Evaluate     json.loads(r"""${orchestration_status_request.content}""", strict=False)    json
+       ${actual_request_state}=     SET VARIABLE       ${orchestration_json_response}[request][requestStatus][requestState]
+       Log To Console    Received actual repsonse status:${actual_request_state}
+       RUN KEYWORD IF   '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED'      Exit For Loop
+       log to console  Will try again after ${SLEEP_INTERVAL_SEC} seconds
+       SLEEP   ${SLEEP_INTERVAL_SEC}s
+    END
+
+    Log To Console     final repsonse status received: ${actual_request_state}
+    Run Keyword If  '${actual_request_state}' == 'COMPLETE'  log to console   \nexecuted with expected result
+    Should Be Equal As Strings    '${actual_request_state}'    'COMPLETE'
diff --git a/tests/so/sanity-check/macroflow_helm.robot b/tests/so/sanity-check/macroflow_helm.robot
new file mode 100644 (file)
index 0000000..7b8b26f
--- /dev/null
@@ -0,0 +1,45 @@
+*** Settings ***
+Library     Collections
+Library     RequestsLibrary
+Library     OperatingSystem
+Library     json
+
+*** Variables ***
+${SLEEP_INTERVAL_SEC}=   30
+${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}=     48     # Represents the maximum number of attempts that will be made before a timeout. It sleeps for SLEEP_INTERVAL_SEC seconds before retry.
+
+*** Test Cases ***
+Distribute Service Template
+    Create Session   sdc_controller_session  http://${REPO_IP}:8085
+    ${data}=    Get Binary File     ${CURDIR}${/}data${/}serviceBasicVfCnfWithHelm.json
+    &{headers}=  Create Dictionary    Authorization=Basic bXNvX2FkbWluOnBhc3N3b3JkMSQ=    resource-location=/distribution-test-zip/unzipped/    Content-Type=application/json    Accept=application/json
+    ${resp}=    POST On Session    sdc_controller_session    /test/treatNotification/v1    data=${data}    headers=${headers}
+    Log To Console     Received status code: ${resp.status_code}
+    Should Be Equal As Strings    '${resp.status_code}'    '200'
+
+
+Macroflow
+    Create Session   api_handler_session  http://${REPO_IP}:8080
+    ${data}=    Get Binary File     ${CURDIR}${/}data${/}MacroflowWithHelm.json
+    &{headers}=  Create Dictionary    Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA==    Content-Type=application/json    Accept=application/json
+    ${service_instantiation_request}=    POST On Session    api_handler_session    /onap/so/infra/serviceInstantiation/v7/serviceInstances    data=${data}    headers=${headers}
+    Log To Console     Received status code: ${service_instantiation_request.status_code}
+    ${service_instantiation_json_response}=    Evaluate     json.loads(r"""${service_instantiation_request.content}""", strict=False)    json
+    ${request_ID}=          Set Variable         ${service_instantiation_json_response}[requestReferences][requestId]
+    ${actual_request_state}=    Set Variable    ""
+
+    FOR    ${INDEX}    IN RANGE    ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT}
+       ${orchestration_status_request}=   Get On Session  api_handler_session   /onap/so/infra/orchestrationRequests/v7/${request_ID}
+       Run Keyword If  '${orchestration_status_request.status_code}' == '200'  log to console   \nexecuted with expected result
+       log to console      ${orchestration_status_request.content}
+       ${orchestration_json_response}=    Evaluate     json.loads(r"""${orchestration_status_request.content}""", strict=False)    json
+       ${actual_request_state}=     SET VARIABLE       ${orchestration_json_response}[request][requestStatus][requestState]
+       Log To Console    Received actual repsonse status:${actual_request_state}
+       RUN KEYWORD IF   '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED'      Exit For Loop
+       log to console  Will try again after ${SLEEP_INTERVAL_SEC} seconds
+       SLEEP   ${SLEEP_INTERVAL_SEC}s
+    END
+
+    Log To Console     final repsonse status received: ${actual_request_state}
+    Run Keyword If  '${actual_request_state}' == 'COMPLETE'  log to console   \nexecuted with expected result
+    Should Be Equal As Strings    '${actual_request_state}'    'COMPLETE'