summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Belu <cbelu@cloudbasesolutions.com>2014-09-01 16:50:28 +0300
committerClaudiu Belu <cbelu@cloudbasesolutions.com>2014-10-14 11:21:59 +0300
commitfaa9891d6c9e6eb98c2a3e748d77cf14f0e65a0e (patch)
treeb8c9bbc8f1be2518b993a65920c2ee243de7566d
parentdbc8e82b84c2f71cb4ab5eecc135b556b449e9b7 (diff)
downloadtempest-faa9891d6c9e6eb98c2a3e748d77cf14f0e65a0e.tar.gz
Adds TestSecurityGroupsBasicOps created VM's security_groups check
In nova.compute.manager.ComputeManager._build_instance, there is the following code: if request_spec and self.is_neutron_security_groups: security_groups = request_spec.get('security_group') else: security_groups = [] Which will verify this from nova.network.security_group.openstack_driver: def is_neutron_security_groups(): return CONF.security_group_api.lower() in ('neutron', 'quantum') This basically means that if the Nova compute node's nova.conf does not contain security_group_api=neutron, the created VMs security_groups will be [], which later will be default. This commit checks the created VM's security_groups, this way it makes sure that the created security group rules will be applied to the VM. Closes-Bug: #1364015 Change-Id: I444c128b6be01e29dd95c8727b7fb676e3dc4eed
-rw-r--r--tempest/scenario/test_security_groups_basic_ops.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py
index 188dea849..6c360341f 100644
--- a/tempest/scenario/test_security_groups_basic_ops.py
+++ b/tempest/scenario/test_security_groups_basic_ops.py
@@ -241,7 +241,11 @@ class TestSecurityGroupsBasicOps(manager.NetworkScenarioTest):
'security_groups': security_groups,
'tenant_id': tenant.creds.tenant_id
}
- return self.create_server(name=name, create_kwargs=create_kwargs)
+ server = self.create_server(name=name, create_kwargs=create_kwargs)
+ self.assertEqual(
+ sorted([s['name'] for s in security_groups]),
+ sorted([s['name'] for s in server['security_groups']]))
+ return server
def _create_tenant_servers(self, tenant, num=1):
for i in range(num):