Add Healing API conformance test based on NFV-TST 71/10671/5
authorKoichi Edagawa <edagawa.kc@nec.com>
Mon, 13 Mar 2023 08:49:00 +0000 (08:49 +0000)
committerKoichi Edagawa <edagawa.kc@nec.com>
Fri, 31 Mar 2023 00:37:25 +0000 (09:37 +0900)
This patch supports API conformance test of Heal CNF with Xtesting
based on ETSI NFV-TST 010 specification.

Issue-ID: SMO-131
Signed-off-by: Koichi Edagawa <edagawa.kc@nec.com>
Change-Id: I2405684adf66235b69067256547cc9aa8b6173b4

tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/cnflcm_keywords.robot
tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/update_config.sh [new file with mode: 0755]
tacker/tacker/tests/xtesting/testcases.yaml

index c798c88..7f8c9be 100644 (file)
@@ -39,6 +39,7 @@ POST instantiate individual cnfInstance
     Set Headers  {"Accept":"${ACCEPT}"}
     Set Headers  {"Content-pe": "${ACCEPT_JSON}"}
     Set Headers    {"${AUTHORIZATION_HEADER}":"${X-Subject-Token}"}
+    Run Process    api-tests/SOL003/cnflcm/update_config.sh  ${Instance_ID}  ${X-Subject-Token}  shell=yes
     ${body}=    Get File    api-tests/SOL003/cnflcm/jsons/inst.json
     Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${Instance_ID}/instantiate    ${body}
     ${outputResponse}=    Output    response
diff --git a/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/update_config.sh b/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/update_config.sh
new file mode 100755 (executable)
index 0000000..a0f5a55
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Update values in variables.txt file
+instance_id='${vnfInstanceId}    '$1
+sed -i "s/$(grep vnfInstanceId api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt)/$instance_id/" api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt
+
+port='${VNFM_PORT}      ''9890'
+sed -i "s/$(grep VNFM_PORT api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt)/$port/" api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt
+
+schema='${VNFM_SCHEMA}    ''http'
+sed -i "s/$(grep VNFM_SCHEMA api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt)/$schema/" api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt
+
+header='${AUTHORIZATION_HEADER}    ''X-Auth-Token'
+sed -i "s/$(grep AUTHORIZATION_HEADER api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt)/$header/" api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt
+
+token='${AUTHORIZATION_TOKEN}     '$2
+sed -i "s/$(grep AUTHORIZATION_TOKEN api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt)/$token/" api-tests/SOL003/VNFLifecycleManagement-API/environment/variables.txt
+
+# Comment out incorrect check step and unnecessary test cases
+sed -i 's/    Check Individual VNF LCM operation occurrence operationState is    STARTING/\#   Check Individual VNF LCM operation occurrence operationState is    STARTING\n\n\*\*\* comment \*\*\*/g' api-tests/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot
+
+#exit 0
+
index 9575cc2..1d7e0b1 100644 (file)
@@ -27,4 +27,15 @@ tiers:
             suites:
               - >-
                 /opt/stack/tacker/tacker/tests/xtesting/api-tests/SOL003/CNFDeployment/IndividualCnfLcmOperationOccurrence.robot
-
+      - case_name: cnf-heal-validation
+        project_name: smo
+        criteria: 100
+        blocking: true
+        clean_flag: false
+        description: ''
+        run:
+          name: robotframework
+          args:
+            suites:
+              - >-
+                /opt/stack/tacker/tacker/tests/xtesting/api-tests/SOL003/VNFLifecycleManagement-API/HealVNFTask.robot