Refactor sol003_01 and sol003_02 tests: suite setup to get resources dir and update cluster tag
Change-Id: I4197e8499c43bdbc592f32f97bd38871518a1082
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot b/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot
index 542b7ab..8ebe5fd 100644
--- a/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot
+++ b/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot
@@ -30,8 +30,9 @@
Resource ../lib/vim_lib.resource
Resource ../lib/nsd_lib.resource
-Test Tags sol003_02 cluster_osm_rest daily
+Test Tags sol003_02 cluster_sol003 daily
+Suite Setup Run Keyword And Ignore Error Suite Preparation
Suite Teardown Run Keyword And Ignore Error Suite Cleanup
@@ -53,8 +54,7 @@
${CREATED_VIM_ACCOUNT_ID}= Get VIM Target ID %{VIM_TARGET}
Set Suite Variable ${CREATED_VIM_ACCOUNT_ID}
Get Auth Token
- ${json_path}= Read Directory
- ${json_obj}= Load JSON From File ${json_path}/sol003_02-dualstack_ip_vnfm.json
+ ${json_obj}= Load JSON From File ${RESOURCE_DIR}/sol003_02-dualstack_ip_vnfm.json
${json_obj}= Get Variable Value ${json_obj['data'][0]}
${NS_NAME}= Get Variable Value ${json_obj['vnfInstanceName']}
Set Suite Variable ${NS_NAME}
@@ -76,8 +76,7 @@
Get Ns List
Get Vnf List
Get Auth Token
- ${json_path}= Read Directory
- ${json_obj}= Load JSON From File ${json_path}/sol003_02-dualstack_ip_vnfm.json
+ ${json_obj}= Load JSON From File ${RESOURCE_DIR}/sol003_02-dualstack_ip_vnfm.json
${json_obj}= Get Variable Value ${json_obj['data'][1]}
${UPDATED_JSON_OBJ}= JSONLibrary.Update Value To Json ${json_obj} $..vimAccountId ${CREATED_VIM_ACCOUNT_ID}
${UPDATED_JSON_OBJ}= JSONLibrary.Update Value To Json ${UPDATED_JSON_OBJ} $..vnfId ${CREATEID}
@@ -126,8 +125,7 @@
Terminate VNF
[Documentation] Test case to terminate the VNF
Get Auth Token
- ${json_path}= Read Directory
- ${UPDATED_JSON_OBJ}= Load JSON From File ${json_path}/sol003_02-dualstack_ip_vnfm.json
+ ${UPDATED_JSON_OBJ}= Load JSON From File ${RESOURCE_DIR}/sol003_02-dualstack_ip_vnfm.json
${UPDATED_JSON_OBJ}= Get Variable Value ${UPDATED_JSON_OBJ['data'][3]}
Set Suite Variable ${UPDATED_JSON_OBJ}
Post Api Request ${VNF_INSTANCE_URI}/${CREATEID}/terminate ${UPDATED_JSON_OBJ}
@@ -164,6 +162,11 @@
*** Keywords ***
+Suite Preparation
+ [Documentation] Test Suite Preparation: Setting Prometheus Testsuite Variables
+ ${RESOURCE_DIR}= Get Resource Directory
+ Set Suite Variable ${RESOURCE_DIR}
+
Suite Cleanup
[Documentation] Test Suit Cleanup: Deleting Descriptor
Run Keyword If Any Tests Failed Delete VNFD ${VNFD_NAME}