Remove excessive quotes in _revert_resize()

When refactoring wait_for(), the status variable was accidentally
quoted, which prevented reverting a resize from working. This fixes
that and adds tests to ensure that it stays fixed.

Change-Id: Iba15c6cc07f190a073ed0e785973987b10e499c8
This commit is contained in:
Chris St. Pierre
2015-12-08 13:03:49 -06:00
parent 70c585dcbd
commit 9ebab8a9f7
3 changed files with 37 additions and 3 deletions

View File

@@ -344,6 +344,26 @@
sla:
failure_rate:
max: 0
-
args:
flavor:
name: "m1.tiny"
image:
name: {{image_name}}
to_flavor:
name: "m1.small"
confirm: false
runner:
type: "constant"
times: 2
concurrency: 2
context:
users:
tenants: 2
users_per_tenant: 1
sla:
failure_rate:
max: 0
NovaServers.boot_server_attach_created_volume_and_resize:
-

View File

@@ -662,7 +662,7 @@ class NovaScenario(scenario.OpenStackScenario):
server.revert_resize()
utils.wait_for(
server,
ready_statuses=["status"],
ready_statuses=[status],
update_resource=utils.get_from_manager(),
timeout=CONF.benchmark.nova_server_resize_revert_timeout,
check_interval=(

View File

@@ -573,9 +573,23 @@ class NovaScenarioTestCase(test.ScenarioTestCase):
self._test_atomic_action_timer(nova_scenario.atomic_actions(),
"nova.resize_confirm")
def test__resize_revert(self):
@ddt.data({},
{"status": "SHUTOFF"})
@ddt.unpack
def test__resize_revert(self, status=None):
nova_scenario = utils.NovaScenario(context=self.context)
nova_scenario._resize_revert(self.server)
if status is None:
nova_scenario._resize_revert(self.server)
status = "ACTIVE"
else:
nova_scenario._resize_revert(self.server, status=status)
self.mock_wait_for.mock.assert_called_once_with(
self.server,
ready_statuses=[status],
update_resource=self.mock_get_from_manager.mock.return_value,
check_interval=CONF.benchmark.
nova_server_resize_revert_poll_interval,
timeout=CONF.benchmark.nova_server_resize_revert_timeout)
self._test_atomic_action_timer(nova_scenario.atomic_actions(),
"nova.resize_revert")