Merge "Add create_and_update_secgroups scenario"
This commit is contained in:
commit
715e45a213
@ -484,6 +484,25 @@
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
NovaSecGroup.create_and_update_secgroups:
|
||||
-
|
||||
args:
|
||||
security_group_count: 5
|
||||
runner:
|
||||
type: "constant"
|
||||
times: 4
|
||||
concurrency: 4
|
||||
context:
|
||||
users:
|
||||
tenants: 3
|
||||
users_per_tenant: 2
|
||||
quotas:
|
||||
nova:
|
||||
security_groups: -1
|
||||
sla:
|
||||
failure_rate:
|
||||
max: 0
|
||||
|
||||
NovaSecGroup.create_and_list_secgroups:
|
||||
-
|
||||
args:
|
||||
|
@ -760,6 +760,20 @@ class NovaScenario(scenario.OpenStackScenario):
|
||||
ip_protocol=ip_protocol,
|
||||
cidr=cidr)
|
||||
|
||||
def _update_security_groups(self, security_groups):
|
||||
"""Update a list of security groups
|
||||
|
||||
:param security_groups: list, security_groups that are to be updated
|
||||
"""
|
||||
with atomic.ActionTimer(self, "nova.update_%s_security_groups" %
|
||||
len(security_groups)):
|
||||
for sec_group in security_groups:
|
||||
sg_new_name = self._generate_random_name()
|
||||
sg_new_desc = self._generate_random_name()
|
||||
self.clients("nova").security_groups.update(sec_group.id,
|
||||
sg_new_name,
|
||||
sg_new_desc)
|
||||
|
||||
def _delete_security_groups(self, security_group):
|
||||
with atomic.ActionTimer(self, "nova.delete_%s_security_groups" %
|
||||
len(security_group)):
|
||||
|
@ -661,6 +661,18 @@ class NovaScenarioTestCase(test.ScenarioTestCase):
|
||||
"nova.create_%s_rules" %
|
||||
(rules_per_security_group * len(fake_secgroups)))
|
||||
|
||||
def test__update_security_groups(self):
|
||||
nova_scenario = utils.NovaScenario()
|
||||
fake_secgroups = [fakes.FakeSecurityGroup(None, None, 1, "uuid1"),
|
||||
fakes.FakeSecurityGroup(None, None, 2, "uuid2")]
|
||||
nova_scenario._update_security_groups(fake_secgroups)
|
||||
self.assertEqual(
|
||||
len(fake_secgroups),
|
||||
self.clients("nova").security_groups.update.call_count)
|
||||
self._test_atomic_action_timer(
|
||||
nova_scenario.atomic_actions(),
|
||||
"nova.update_%s_security_groups" % len(fake_secgroups))
|
||||
|
||||
def test__delete_security_groups(self):
|
||||
nova_scenario = utils.NovaScenario()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user