Robot testcase for DualStackip 22/14122/10
authorrarik <arika.r@tataelxsi.co.in>
Thu, 14 Dec 2023 07:14:53 +0000 (07:14 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 15 Dec 2023 21:19:49 +0000 (22:19 +0100)
Change-Id: Ic21e3b4aa35718dc2d9dad91a2ae57f45c5defcd
Signed-off-by: rarik <arika.r@tataelxsi.co.in>
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
robot-systest/lib/openstack_lib.resource
robot-systest/lib/rest_lib.resource
robot-systest/resources/sol003_02-dualstack_ip_vnfm.json [new file with mode: 0644]
robot-systest/resources/sol003_Dualstackip.json [deleted file]
robot-systest/testsuite/sol003_02-dualstack_ip_vnfm.robot

index ff4b46d..3ad237b 100644 (file)
@@ -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
index 74e97e9..82c95d2 100644 (file)
@@ -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 (file)
index 0000000..74cc2ef
--- /dev/null
@@ -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 (file)
index a1b1b49..0000000
+++ /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"
-      }
-   ]
-}
-
index 6a2ae7a..b489dc4 100644 (file)
@@ -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}