Add initial configurations + basic test for ETSI NFVO NS LCM CSIT Tests 67/117867/2
authorrope252 <gareth.roper@est.tech>
Fri, 12 Feb 2021 12:39:12 +0000 (12:39 +0000)
committerrope252 <gareth.roper@est.tech>
Tue, 16 Feb 2021 15:31:56 +0000 (15:31 +0000)
Change-Id: Icbcac6c89a0635306c0502e558159618c5df8e58
Issue-ID: INT-1839
Signed-off-by: rope252 <gareth.roper@est.tech>
plans/so/integration-etsi-testing/config/aai-simulator-populate-data/customer.json
plans/so/integration-etsi-testing/config/override-files/so-etsi-nfvo-ns-lcm/onapheat/override.yaml [new file with mode: 0644]
plans/so/integration-etsi-testing/docker-compose.yml
plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.csar
plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/test/java/org/onap/so/sdcsimulator/controller/CatalogControllerTest.java
plans/so/integration-etsi-testing/testplan.txt
tests/so/etsi/data/createNetworkServiceRequest.json [new file with mode: 0644]
tests/so/etsi/data/networkServicePackageOnboardRequest.json [new file with mode: 0644]
tests/so/etsi/etsi_nfvo_ns_lcm_tests.robot [new file with mode: 0644]
tests/so/etsi/etsi_package_onboarding_tests.robot

index 6c53c05..931e31e 100644 (file)
                         }
                     ]
                 }
+            },
+           {
+                "service-type": "NetworkService",
+                "relationship-list": {
+                    "relationship": [
+                        {
+                            "related-to": "tenant",
+                            "relationship-label": "org.onap.relationships.inventory.Uses",
+                            "related-link": "/aai/v14/cloud-infrastructure/cloud-regions/cloud-region/CloudOwner/xyzcloud/tenants/tenant/693c7729b2364a26a3ca602e6f66187d",
+                            "relationship-data": [
+                                {
+                                    "relationship-key": "cloud-region.cloud-owner",
+                                    "relationship-value": "CloudOwner"
+                                },
+                                {
+                                    "relationship-key": "cloud-region.cloud-region-id",
+                                    "relationship-value": "xyzcloud"
+                                },
+                                {
+                                    "relationship-key": "tenant.tenant-id",
+                                    "relationship-value": "693c7729b2364a26a3ca602e6f66187d"
+                                }
+                            ],
+                            "related-to-property": [
+                                {
+                                    "property-key": "tenant.tenant-name",
+                                    "property-value": "admin"
+                                }
+                            ]
+                        }
+                    ]
+                }
             }
         ]
     }
diff --git a/plans/so/integration-etsi-testing/config/override-files/so-etsi-nfvo-ns-lcm/onapheat/override.yaml b/plans/so/integration-etsi-testing/config/override-files/so-etsi-nfvo-ns-lcm/onapheat/override.yaml
new file mode 100644 (file)
index 0000000..bb35d1f
--- /dev/null
@@ -0,0 +1,47 @@
+aai:
+  auth: 221187EFA3AD4E33600DE0488F287099934CE65C3D0697BCECC00BB58E784E07CD74A24581DC31DBC086FF63DF116378776E9BE3D1325885
+  version: v15
+  endpoint: https://aai-simulator:9993
+spring:
+  datasource:
+    hikari:
+      camunda:
+        jdbcUrl: jdbc:mariadb://mariadb:3306/camundabpmn
+        username: so_user
+        password: so_User123
+        driver-class-name: org.mariadb.jdbc.Driver
+        pool-name: bpmn-pool
+        registerMbeans: true
+      nfvo:
+        jdbcUrl: jdbc:mariadb://mariadb:3306/nfvo
+        username: so_admin
+        password: so_Admin123
+        driver-class-name: org.mariadb.jdbc.Driver
+        pool-name: nfvo-pool
+        registerMbeans: true
+  security:
+    usercredentials:
+    - username: so-etsi-nfvo-ns-lcm
+      password: $2a$10$Fh9ffgPw2vnmsghsRD3ZauBL1aKXebigbq3BB1RPWtE62UDILsjke
+      role: ETSI-NFVO-Client
+server:
+  port: 9095
+  tomcat:
+    max-threads: 50
+mso:
+  key: 07a7159d3bf51a0e53be7a8f89699be7
+so:
+  adapters:
+    sol003-adapter:
+      url: http://so-vnfm-adapter:9092/so/vnfm-adapter/v1
+      auth: Basic dm5mbTpwYXNzd29yZDEk
+etsi-catalog-manager:
+  base:
+    endpoint: http://modeling-etsicatalog:8806/api
+camunda:
+  bpm:
+    history-level: full
+    job-execution:
+      max-pool-size: 30
+      core-pool-size: 3
+      deployment-aware: true
index cc75311..1d51221 100644 (file)
@@ -376,3 +376,31 @@ services:
         max-size: "30m"
         max-file: "5"
     entrypoint: /bin/sh -c '/service/wait-for.sh -t 300 -h mariadb -p 3306 && /service/modeling/etsicatalog/docker/docker-entrypoint.sh'
+###############################################################################
+  so-etsi-nfvo-ns-lcm:
+    image: ${NEXUS_DOCKER_REPO_MSO}/onap/so/so-etsi-nfvo-ns-lcm:${TAG}
+    ports:
+      - "9095:9095"
+    volumes:
+      - ${CONFIG_DIR_PATH}/override-files/so-etsi-nfvo-ns-lcm/onapheat:/app/config
+      - ${CONFIG_DIR_PATH}/certificates/truststore/root-ca.crt:/app/ca-certificates/root-ca.crt
+      - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates
+    environment:
+      - APP=so-etsi-nfvo-ns-lcm
+      - 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:
+      etsi.nfvo.ns.lcm
+    depends_on:
+      - mariadb
+      - aai-simulator
+      - sdc-simulator
+      - modeling-etsicatalog
+      - so-vnfm-adapter
+    user: root
+    entrypoint: /bin/sh -c '/app/wait-for.sh -q -t "300" mariadb:3306 -- "/app/start-app.sh"'
index 6504cb1..1610b7f 100644 (file)
Binary files a/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.csar and b/plans/so/integration-etsi-testing/so-simulators/sdc-simulator/src/main/resources/csar/SERVICES/9bb8c882-44a1-4b67-a12c-5a998e18d6ba.csar differ
index 249010a..963abb9 100644 (file)
@@ -5,3 +5,4 @@ so/etsi/etsi_package_onboarding_tests.robot
 so/etsi/etsi_vnf_lcm_tests.robot
 so/etsi/etsi_vnf_package_management_tests.robot
 so/etsi/etsi_vnf_notification_tests.robot
+so/etsi/etsi_nfvo_ns_lcm_tests.robot
diff --git a/tests/so/etsi/data/createNetworkServiceRequest.json b/tests/so/etsi/data/createNetworkServiceRequest.json
new file mode 100644 (file)
index 0000000..6980068
--- /dev/null
@@ -0,0 +1 @@
+{"nsdId": "9bb8c882-44a1-4b67-a12c-5a998e18d6ba", "nsName": "demo", "nsDescription": "demo"}
diff --git a/tests/so/etsi/data/networkServicePackageOnboardRequest.json b/tests/so/etsi/data/networkServicePackageOnboardRequest.json
new file mode 100644 (file)
index 0000000..f6ffeb2
--- /dev/null
@@ -0,0 +1 @@
+{"csarId": "9bb8c882-44a1-4b67-a12c-5a998e18d6ba"}
diff --git a/tests/so/etsi/etsi_nfvo_ns_lcm_tests.robot b/tests/so/etsi/etsi_nfvo_ns_lcm_tests.robot
new file mode 100644 (file)
index 0000000..e931b3c
--- /dev/null
@@ -0,0 +1,27 @@
+*** Settings ***
+Library     Collections
+Library     RequestsLibrary
+Library     OperatingSystem
+Library     json
+Library     ArchiveLibrary
+
+*** Variables ***
+${NFVO_NS_LCM_BASE_URL}=    /so/so-etsi-nfvo-ns-lcm/v1/api/nslcm/v1
+${BASIC_AUTH}=    Basic c28tZXRzaS1uZnZvLW5zLWxjbTpwYXNzd29yZDEk
+
+*** Test Cases ***
+
+Invoke Create Network Service
+    Create Session   etsi_nfvo_ns_lcm_session  http://${REPO_IP}:9095
+    ${data}=    Get Binary File     ${CURDIR}${/}data${/}createNetworkServiceRequest.json
+    &{headers}=  Create Dictionary    Authorization=${BASIC_AUTH}    Content-Type=application/json    Accept=application/json    HTTP_GLOBALCUSTOMERID=DemoCustomer
+    ${create_network_service_request}=    POST On Session    etsi_nfvo_ns_lcm_session    ${NFVO_NS_LCM_BASE_URL}/ns_instances    data=${data}    headers=${headers}
+    log to console      ${create_network_service_request.content}
+    ${create_network_service_json_response}=    Evaluate     json.loads(r"""${create_network_service_request.content}""", strict=False)    json
+    ${request_Id}=          Set Variable         ${create_network_service_json_response}[id]
+    SET GLOBAL VARIABLE       ${request_Id}
+
+    Run Keyword If  '${create_network_service_request.status_code}' == '201'  log to console  \nexecuted with expected result
+    log to console      \nCreate Network Service Response Status Code: ${create_network_service_request.status_code}
+    Should Be Equal As Strings    '${create_network_service_request.status_code}'    '201'
+
index 96c9896..2b2054d 100644 (file)
@@ -46,6 +46,17 @@ OnBoard VNF Package In Etsi Catalog
     Run Keyword If  '${actual_job_status}' == 'finished'  log to console   \nexecuted with expected result
     Should Be Equal As Strings    '${actual_job_status}'    'finished'
 
+Onboard Network Service Package In Etsi Catalog
+    Create Session   etsi_catalog_session  http://${REPO_IP}:8806
+    ${data}=    Get Binary File     ${CURDIR}${/}data${/}networkServicePackageOnboardRequest.json
+    &{headers}=  Create Dictionary    Content-Type=application/json    Accept=application/json
+    ${resp}=    POST On Session    etsi_catalog_session    /api/catalog/v1/nspackages    data=${data}    headers=${headers}
+    log to console      ${resp.content}
+
+    Run Keyword If  '${resp.status_code}' == '202'  log to console  \nexecuted with expected result
+    Should Be Equal As Strings    '${resp.status_code}'    '202'
+
+
 Distribute Service Template
     Create Session   sdc_controller_session  http://${REPO_IP}:8085
     ${data}=    Get Binary File     ${CURDIR}${/}data${/}distributeServiceTemplate.json