From: Koichi Edagawa Date: Mon, 13 Mar 2023 08:49:00 +0000 (+0000) Subject: Add Healing API conformance test based on NFV-TST X-Git-Tag: l-release~26 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F10671%2F5;p=smo%2Fo2.git Add Healing API conformance test based on NFV-TST 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 Change-Id: I2405684adf66235b69067256547cc9aa8b6173b4 --- diff --git a/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/cnflcm_keywords.robot b/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/cnflcm_keywords.robot index c798c88..7f8c9be 100644 --- a/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/cnflcm_keywords.robot +++ b/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/cnflcm_keywords.robot @@ -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 index 0000000..a0f5a55 --- /dev/null +++ b/tacker/tacker/tests/xtesting/api-tests/SOL003/cnflcm/update_config.sh @@ -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 + diff --git a/tacker/tacker/tests/xtesting/testcases.yaml b/tacker/tacker/tests/xtesting/testcases.yaml index 9575cc2..1d7e0b1 100644 --- a/tacker/tacker/tests/xtesting/testcases.yaml +++ b/tacker/tacker/tests/xtesting/testcases.yaml @@ -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