Robot testcase for DualStackip
[osm/tests.git] / robot-systest / lib / openstack_lib.resource
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