Add tags for 'prepare' and 'verify' stages to help the testing of OSM version migrati...
[osm/tests.git] / robot-systest / lib / ns_lib.robot
index a38a69e..2d6fdb7 100644 (file)
@@ -76,6 +76,17 @@ Get Vnf Id
     [Return]  ${stdout}
 
 
+Get Ns Id
+    [Arguments]   ${ns_name}
+
+    Should Not Be Empty   ${ns_name}
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm ns-list | grep ${ns_name} | awk '{print $4}' 2>&1
+    log   ${stdout}
+    Should Be Equal As Integers   ${rc}   ${success_return_code}
+    Should Not Be Empty   ${stdout}
+    [Return]   ${stdout}
+
+
 Get Ns Vnf List
     [Arguments]   ${ns_id}
 
@@ -286,4 +297,5 @@ Get Application Names
     ${rc}  ${stdout}=  Run and Return RC and Output  osm ns-show ${ns_name} --literal | yq ._admin.deployed.VCA[].application | tr -d \\"
     Should Be Equal As Integers  ${rc}  ${success_return_code}  msg=${stdout}  values=False
     @{app_names} =  Split String  ${stdout}
-    [Return]  ${app_names}
\ No newline at end of file
+    [Return]  ${app_names}
+