From 1df75ee5025c2f1efad86dd86c350865d1893b29 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Mon, 30 Oct 2017 12:52:51 -0400 Subject: [PATCH] Move and update test_resize_volume_backed_server_confirm There is a bug in nova where the libvirt driver incorrectly removes the local guest files for the hypervisor from shared storage because it does not realize the instance is volume-backed. Nova runs an NFS CI job in the experimental queue but it's not failing on resize tests because they aren't volume-backed, so to recreate the failure and make sure we don't regress the fix, this test is added. Nova also runs a Ceph job which applies here too. This moves the existing scenario test to be a compute API test. The test ID is maintained in case people are blacklisting it, but the slow tag is dropped because it's not a particularly slow test and if the slow tag is applied, it won't actually be run in the jobs that we care about testing this, e.g. NFS and Ceph jobs. The additional wrinkle of getting the console log after the resize is what shows the failure when the bug is not fixed, so that's added here. Depends-On: I29fac80d08baf64bf69e54cf673e55123174de2a Change-Id: Id7de5186b2ea0ff7af86d9950c69203914498d88 Related-Bug: #1728603 --- .../compute/servers/test_server_actions.py | 16 ++++++++++++++ tempest/scenario/test_server_advanced_ops.py | 22 ------------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py index aa06ae85b5..bce752445c 100644 --- a/tempest/api/compute/servers/test_server_actions.py +++ b/tempest/api/compute/servers/test_server_actions.py @@ -315,6 +315,22 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest): def test_resize_server_confirm(self): self._test_resize_server_confirm(self.server_id, stop=False) + @decorators.idempotent_id('e6c28180-7454-4b59-b188-0257af08a63b') + @decorators.related_bug('1728603') + @testtools.skipUnless(CONF.compute_feature_enabled.resize, + 'Resize not available.') + @utils.services('volume') + def test_resize_volume_backed_server_confirm(self): + # We have to create a new server that is volume-backed since the one + # from setUp is not volume-backed. + server = self.create_test_server( + volume_backed=True, wait_until='ACTIVE') + self._test_resize_server_confirm(server['id']) + # Now do something interactive with the guest like get its console + # output; we don't actually care about the output, just that it doesn't + # raise an error. + self.client.get_console_output(server['id']) + @decorators.idempotent_id('138b131d-66df-48c9-a171-64f45eb92962') @testtools.skipUnless(CONF.compute_feature_enabled.resize, 'Resize not available.') diff --git a/tempest/scenario/test_server_advanced_ops.py b/tempest/scenario/test_server_advanced_ops.py index d4f29ad07a..89b9fddb61 100644 --- a/tempest/scenario/test_server_advanced_ops.py +++ b/tempest/scenario/test_server_advanced_ops.py @@ -41,28 +41,6 @@ class TestServerAdvancedOps(manager.ScenarioTest): cls.set_network_resources() super(TestServerAdvancedOps, cls).setup_credentials() - @decorators.attr(type='slow') - @decorators.idempotent_id('e6c28180-7454-4b59-b188-0257af08a63b') - @testtools.skipUnless(CONF.compute_feature_enabled.resize, - 'Resize is not available.') - @utils.services('compute', 'volume') - def test_resize_volume_backed_server_confirm(self): - # We create an instance for use in this test - instance = self.create_server(volume_backed=True) - instance_id = instance['id'] - resize_flavor = CONF.compute.flavor_ref_alt - LOG.debug("Resizing instance %s from flavor %s to flavor %s", - instance['id'], instance['flavor']['id'], resize_flavor) - self.servers_client.resize_server(instance_id, resize_flavor) - waiters.wait_for_server_status(self.servers_client, instance_id, - 'VERIFY_RESIZE') - - LOG.debug("Confirming resize of instance %s", instance_id) - self.servers_client.confirm_resize_server(instance_id) - - waiters.wait_for_server_status(self.servers_client, instance_id, - 'ACTIVE') - @decorators.attr(type='slow') @decorators.idempotent_id('949da7d5-72c8-4808-8802-e3d70df98e2c') @testtools.skipUnless(CONF.compute_feature_enabled.suspend,