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
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}
--- /dev/null
+{
+ "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"
+ }
+ ]
+}
+++ /dev/null
-{
- "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"
- }
- ]
-}
-
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}
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}
[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}