From 476f84f7313383dd6ffbc8b78002e5440b15d44a Mon Sep 17 00:00:00 2001 From: lianghao Date: Fri, 12 Jan 2018 13:05:16 +0800 Subject: [PATCH] Add flavor check after resize server Change-Id: Ie2d57029ad01cbe9e2b015857d6b95f77a97be19 --- tempest/api/compute/base.py | 5 +++++ tempest/scenario/test_network_advanced_server_ops.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py index ac03cdcbd0..5f273d3835 100644 --- a/tempest/api/compute/base.py +++ b/tempest/api/compute/base.py @@ -352,6 +352,11 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest, 'VERIFY_RESIZE') cls.servers_client.confirm_resize_server(server_id) waiters.wait_for_server_status(cls.servers_client, server_id, 'ACTIVE') + server = cls.servers_client.show_server(server_id)['server'] + if new_flavor_id != server['flavor']['id']: + msg = ('Flavor id of %s is not equal to new_flavor_id.' + % server_id) + raise lib_exc.TempestException(msg) @classmethod def delete_volume(cls, volume_id): diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py index 7c404ad6e0..e4ab11cd5f 100644 --- a/tempest/scenario/test_network_advanced_server_ops.py +++ b/tempest/scenario/test_network_advanced_server_ops.py @@ -195,6 +195,8 @@ class TestNetworkAdvancedServerOps(manager.NetworkScenarioTest): waiters.wait_for_server_status(self.servers_client, server['id'], 'VERIFY_RESIZE') self.servers_client.confirm_resize_server(server['id']) + server = self.servers_client.show_server(server['id'])['server'] + self.assertEqual(resize_flavor, server['flavor']['id']) self._wait_server_status_and_check_network_connectivity( server, keypair, floating_ip)