Use api_extensions to decide security_group type nova used
Even the system enables neutron, if neutron's security_group
extension is disabled, Nova can still use nova's security_group
by setting security_group_api=nova in nova.conf. So this is to
use neutron's security group only when neutron is enabled and
neutron's security_group extension is enabled.
Change-Id: I713b2fb04400c1b892aec9b09e0ff744db8d8d4e
Closes-Bug: #1583851
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index 5125e2b..e6abf28 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -44,9 +44,11 @@
security_group_id.append(body[i]['id'])
# Generate a non-existent security group id
while True:
- non_exist_id = data_utils.rand_int_id(start=999)
- if self.neutron_available:
+ if (self.neutron_available and
+ test.is_extension_enabled('security-group', 'network')):
non_exist_id = data_utils.rand_uuid()
+ else:
+ non_exist_id = data_utils.rand_int_id(start=999)
if non_exist_id not in security_group_id:
break
return non_exist_id