Adding test BASIC24: Testing feature 10906 support of affinity groups
[osm/tests.git] / robot-systest / lib / openstack_lib.robot
index 884ec4f..d544bb5 100644 (file)
@@ -71,6 +71,18 @@ Get Server Property
     [Return]  ${stdout}
 
 
+Check VM In Server Group
+    [Documentation]   Check if a given server is included in an Openstack server group
+    [Arguments]   ${server_id}   ${server_group_name}
+
+    Should Not Be Empty   ${server_group_name}
+    Should Not Be Empty   ${server_id}
+    ${rc}   ${stdout}=   Run and Return RC and Output   openstack server group show ${server_group_name} -c members -f value
+    log   ${stdout}
+    Should Be Equal As Integers   ${rc}   ${success_return_code}
+    Should Contain   ${stdout}   ${server_id}
+
+
 Check If Volume Exists
     [Documentation]     Checks if a volume id exists
     [Arguments]    ${volume_id}