From: rarik Date: Thu, 14 Dec 2023 07:14:53 +0000 (+0000) Subject: Robot testcase for DualStackip X-Git-Tag: release-v15.0-start~4 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F14122%2F10;p=osm%2Ftests.git Robot testcase for DualStackip Change-Id: Ic21e3b4aa35718dc2d9dad91a2ae57f45c5defcd Signed-off-by: rarik Signed-off-by: garciadeblas --- diff --git a/robot-systest/lib/openstack_lib.resource b/robot-systest/lib/openstack_lib.resource index ff4b46d..3ad237b 100644 --- a/robot-systest/lib/openstack_lib.resource +++ b/robot-systest/lib/openstack_lib.resource @@ -191,3 +191,17 @@ Delete Flavor Log ${stdout} Should Be Equal As Integers ${rc} ${SUCCESS_RETURN_CODE} RETURN ${stdout} + +Openstack Server List + [Documentation] Get the openstack server list + [Arguments] ${ns_name} + ${result}= Run And Return Rc And Output openstack server list | grep ${ns_name} | awk 'index($0, "ipv6=") {gsub(/,$/, ""); gsub("ipv6=", ""); print $8, $9}' + ${rc}= Get From List ${result} 0 + ${Ip}= Get From List ${result} 1 + Log ${Ip} + Should Be Equal As Integers ${rc} ${success_return_code} + RETURN ${Ip} + +Source Openrc Command + [Documentation] Keyword to source openstack tenant + Write source openrc diff --git a/robot-systest/lib/rest_lib.resource b/robot-systest/lib/rest_lib.resource index 74e97e9..82c95d2 100644 --- a/robot-systest/lib/rest_lib.resource +++ b/robot-systest/lib/rest_lib.resource @@ -65,7 +65,7 @@ Set Standalone Host Read Directory [Documentation] Read Current Directory and return it - ${Directory}= Replace String ${CURDIR} lib resources/ + ${Directory}= Replace String ${CURDIR} lib resources ${json_path}= Set Variable ${Directory} RETURN ${json_path} diff --git a/robot-systest/resources/sol003_02-dualstack_ip_vnfm.json b/robot-systest/resources/sol003_02-dualstack_ip_vnfm.json new file mode 100644 index 0000000..74cc2ef --- /dev/null +++ b/robot-systest/resources/sol003_02-dualstack_ip_vnfm.json @@ -0,0 +1,40 @@ +{ + "data":[ + { + "vnfdId":"hackfest_basic-vnf", + "vnfInstanceName":"sol003-instance", + "vnfInstanceDescription":"Test vnfm instance description", + "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5", + "additionalParams":{ + "virtual-link-desc":[ + { + "id":"mgmtnet", + "mgmt-network":true, + "vim-network-name": "IPv6" + } + ], + "constituent-cpd-id":"vnf-cp0-ext", + "ip-address": ["2001:db8::5", "192.168.158.6"], + "virtual-link-profile-id":"mgmtnet" + } + }, + { + "vnfName":"sol003-instance", + "vnfDescription":"vnf package", + "vnfId":"70b47595-fafa-4f63-904b-fc3ada60eebb", + "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5" + }, + { + "type":"SCALE_OUT", + "aspectId":"vdu_autoscale", + "numberOfSteps":"1", + "additionalParams":{ + "member-vnf-index":"1" + } + }, + { + "terminationType":"GRACEFUL", + "gracefulTerminationTimeout":"5" + } + ] +} diff --git a/robot-systest/resources/sol003_Dualstackip.json b/robot-systest/resources/sol003_Dualstackip.json deleted file mode 100644 index a1b1b49..0000000 --- a/robot-systest/resources/sol003_Dualstackip.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "data":[ - { - "vnfdId":"hackfest_basic-vnf", - "vnfInstanceName":"sol003-instance", - "vnfInstanceDescription":"Test vnfm instance description", - "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5", - "additionalParams":{ - "virtual-link-desc":[ - { - "id":"mgmtnet", - "mgmt-network":true, - "vim-network-name": "IPv6" - } - ], - "constituent-cpd-id":"vnf-cp0-ext", - "ip-address": ["2001:db8::5", "192.168.158.6"], - "virtual-link-profile-id":"mgmtnet" - } - }, - { - "vnfName":"sol003-instance", - "vnfDescription":"vnf package", - "vnfId":"70b47595-fafa-4f63-904b-fc3ada60eebb", - "vimAccountId":"8dc2f11d-e08a-4ec7-920c-6b8a88bff1e5" - }, - { - "type":"SCALE_OUT", - "aspectId":"vdu_autoscale", - "numberOfSteps":"1", - "additionalParams":{ - "member-vnf-index":"1" - } - }, - { - "terminationType":"GRACEFUL", - "gracefulTerminationTimeout":"5" - } - ] -} - diff --git a/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot b/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot index 6a2ae7a..b489dc4 100644 --- a/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot +++ b/robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot @@ -53,7 +53,7 @@ Create VNFD Descriptor Set Suite Variable ${CREATED_VIM_ACCOUNT_ID} Get Auth Token ${json_path}= Read Directory - ${json_obj}= Load JSON From File ${json_path}/sol003_DualStackip.json + ${json_obj}= Load JSON From File ${json_path}/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} @@ -78,7 +78,7 @@ Instantiate VNF Get Vnf List Get Auth Token ${json_path}= Read Directory - ${json_obj}= Load JSON From File ${json_path}/sol003_DualStackip.json + ${json_obj}= Load JSON From File ${json_path}/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} @@ -165,7 +165,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_DualStackip.json + ${UPDATED_JSON_OBJ}= Load JSON From File ${json_path}/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}