Add test of remove all security groups in test_server_actions.py
If you omit the attribute of security_groups, the API creates the server
in the default security group,and also openstack can accept to
remove all security groups of server ,so add the test.
Change-Id: I39e272f7b7655a9821cc5ff9e5701f9da80c9bd4
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index d810ff7..d0f4b1b 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -145,6 +145,18 @@
# The server should be signaled to reboot gracefully
self._test_reboot_server('SOFT')
+ @decorators.idempotent_id('1d1c9104-1b0a-11e7-a3d4-fa163e65f5ce')
+ def test_remove_server_all_security_groups(self):
+ server = self.create_test_server(wait_until='ACTIVE')
+
+ # Remove all Security group
+ self.client.remove_security_group(
+ server['id'], name=server['security_groups'][0]['name'])
+
+ # Verify all Security group
+ server = self.client.show_server(server['id'])['server']
+ self.assertNotIn('security_groups', server)
+
def _rebuild_server_and_check(self, image_ref):
rebuilt_server = (self.client.rebuild_server(self.server_id, image_ref)
['server'])