Robot fix for Autohealing tests
[osm/tests.git] / robot-systest / lib / ns_lib.robot
index 3cd863e..c864218 100644 (file)
@@ -373,3 +373,17 @@ Get VDU Affinity Group Name
     log   ${affinity_group_name}
     Should Be Equal As Integers   ${rc}   ${success_return_code}   msg=${affinity_group_name}   values=False
     [Return]   ${affinity_group_name}
+
+
+Get Operations By Type
+    [Documentation]   Keyword to get the operation by type
+
+    [Arguments]   ${ns_id}    ${type}
+
+    Should Not Be Empty   ${ns_id}
+    Should Not Be Empty   ${type}
+    ${rc}   ${stdout}=   Run and Return RC and Output   osm ns-op-list ${ns_id} | grep ${type} | awk '{print $2}' 2>&1
+    log   ${stdout}
+    Should Be Equal As Integers   ${rc}   ${success_return_code}
+    Should Not Be Empty   ${stdout}
+    [Return]   ${stdout}