Revert "ns_lib: new env variable to set NS instantiation timeout for testing"
[osm/tests.git] / robot-systest / lib / ns_lib.robot
index b3c912f..57eb6f5 100644 (file)
@@ -13,7 +13,7 @@
 *** Variables ***
 ${success_return_code}   0
 ${ns_launch_pol_time}   30sec
-${ns_delete_max_wait_time}   3min
+${ns_delete_max_wait_time}   4min
 ${ns_delete_pol_time}   15sec
 ${ns_action_max_wait_time}   1min
 ${ns_action_pol_time}   15sec
@@ -57,6 +57,17 @@ Get Vnf Management Ip Address
     [Return]  ${stdout}
 
 
+Get Vnf Id
+    [Arguments]   ${ns_id}   ${vnf_member_index}
+
+    Should Not Be Empty   ${ns_id}
+    Should Not Be Empty   ${vnf_member_index}
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm vnf-list --filter member-vnf-index-ref=${vnf_member_index} | grep ${ns_id} | awk '{print $2}' 2>&1
+    log   ${stdout}
+    Should Be Equal As Integers   ${rc}   ${success_return_code}
+    [Return]  ${stdout}
+
+
 Get Ns Vnf List
     [Arguments]   ${ns_id}
 
@@ -86,7 +97,7 @@ Get Vnf Ip List
     [arguments]   ${vnf_id}
 
     should not be empty   ${vnf_id}
-    @{vnf_ip_list_string}=   run and return rc and output   osm vnf-show ${vnf_id} --filter vdur --literal | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' | sort -t: -u -k1,1 2>&1
+    @{vnf_ip_list_string}=   run and return rc and output   osm vnf-list --filter id=${vnf_id} | grep -o '[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}' | sort -t: -u -k1,1 2>&1
     # returns a string of ip addresses and needs to be converted into a list
     should not be empty   ${vnf_ip_list_string}[1]
     @{vnf_ip_list} =  split string    ${vnf_ip_list_string}[1]