Skip resize tests when cold_migration is disabled

The resize is a cold migration by nature, disable tests
when cold migration is not allowed.

Change-Id: I754024a6376ed54aa96b162e3f08a77896bbd4e1
Related-Prod: PRODX-3456
(cherry picked from commit 1ab1fd45c09a039db50ea7dfdcdc56b953ff956d)
diff --git a/tempest/api/compute/admin/test_migrations.py b/tempest/api/compute/admin/test_migrations.py
index b3d2833..91b15fb 100644
--- a/tempest/api/compute/admin/test_migrations.py
+++ b/tempest/api/compute/admin/test_migrations.py
@@ -38,8 +38,9 @@
         self.client.list_migrations()
 
     @decorators.idempotent_id('1b512062-8093-438e-b47a-37d2f597cd64')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_list_migrations_in_flavor_resize_situation(self):
         """Admin can get the migrations list containing the resized server"""
         server = self.create_test_server(wait_until="ACTIVE")
@@ -60,8 +61,9 @@
             pass
 
     @decorators.idempotent_id('33f1fec3-ba18-4470-8e4e-1d888e7c3593')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_resize_server_revert_deleted_flavor(self):
         """Test reverting resized server with original flavor deleted
 
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
index f52d4c0..740773b 100644
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -43,8 +43,9 @@
         cls.s1_id = server['id']
 
     @decorators.idempotent_id('28dcec23-f807-49da-822c-56a92ea3c687')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_server_using_overlimit_ram(self):
         """Test resizing server using over limit ram should fail"""
@@ -66,8 +67,9 @@
                           flavor_ref['id'])
 
     @decorators.idempotent_id('7368a427-2f26-4ad9-9ba9-911a0ec2b0db')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_server_using_overlimit_vcpus(self):
         """Test resizing server using over limit vcpus should fail"""
diff --git a/tempest/api/compute/servers/test_delete_server.py b/tempest/api/compute/servers/test_delete_server.py
index ee25a22..fdf0975 100644
--- a/tempest/api/compute/servers/test_delete_server.py
+++ b/tempest/api/compute/servers/test_delete_server.py
@@ -94,8 +94,9 @@
         waiters.wait_for_server_termination(self.client, server['id'])
 
     @decorators.idempotent_id('ab0c38b4-cdd8-49d3-9b92-0cb898723c01')
-    @testtools.skipIf(not CONF.compute_feature_enabled.resize,
-                      'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_delete_server_while_in_verify_resize_state(self):
         """Test deleting a server while it's VM state is VERIFY_RESIZE"""
         server = self.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_disk_config.py b/tempest/api/compute/servers/test_disk_config.py
index e5e051a..35c5619 100644
--- a/tempest/api/compute/servers/test_disk_config.py
+++ b/tempest/api/compute/servers/test_disk_config.py
@@ -88,8 +88,9 @@
         self.assertEqual('AUTO', server['OS-DCF:diskConfig'])
 
     @decorators.idempotent_id('414e7e93-45b5-44bc-8e03-55159c6bfc97')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_resize_server_from_manual_to_auto(self):
         """A server should be resized from manual to auto disk config"""
         server = self.create_test_server(wait_until='ACTIVE')
@@ -104,8 +105,9 @@
         self.assertEqual('AUTO', server['OS-DCF:diskConfig'])
 
     @decorators.idempotent_id('693d16f3-556c-489a-8bac-3d0ca2490bad')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_resize_server_from_auto_to_manual(self):
         """A server should be resized from auto to manual disk config"""
         server = self.create_test_server(wait_until='ACTIVE')
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index e6e005c..ee5ce09 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -328,16 +328,18 @@
             self.client.start_server(server_id)
 
     @decorators.idempotent_id('1499262a-9328-4eda-9068-db1ac57498d2')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_resize_server_confirm(self):
         """Test resizing server and then confirming"""
         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.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     @utils.services('volume')
     def test_resize_volume_backed_server_confirm(self):
         """Test resizing a volume backed server and then confirming"""
@@ -372,15 +374,17 @@
             linux_client.validate_authentication()
 
     @decorators.idempotent_id('138b131d-66df-48c9-a171-64f45eb92962')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_resize_server_confirm_from_stopped(self):
         """Test resizing a stopped server and then confirming"""
         self._test_resize_server_confirm(self.server_id, stop=True)
 
     @decorators.idempotent_id('c03aab19-adb1-44f5-917d-c419577e9e68')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_resize_server_revert(self):
         """Test resizing server and then reverting
 
@@ -403,8 +407,9 @@
 
     @decorators.idempotent_id('fbbf075f-a812-4022-bc5c-ccb8047eef12')
     @decorators.related_bug('1737599')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     @utils.services('volume')
     def test_resize_server_revert_with_volume_attached(self):
         """Test resizing a volume attached server and then reverting
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index 4f85048..5a05f69 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -128,8 +128,9 @@
                           self.create_test_server, accessIPv6=IPv6)
 
     @decorators.idempotent_id('7ea45b3e-e770-46fa-bfcc-9daaf6d987c0')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_nonexistent_server(self):
         """Resizing a non-existent server should fail"""
@@ -139,8 +140,9 @@
                           nonexistent_server, self.flavor_ref)
 
     @decorators.idempotent_id('ced1a1d7-2ab6-45c9-b90f-b27d87b30efd')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_server_with_non_existent_flavor(self):
         """Resizing a server with non existent flavor should fail"""
@@ -149,8 +151,9 @@
                           self.server_id, flavor_ref=nonexistent_flavor)
 
     @decorators.idempotent_id('45436a7d-a388-4a35-a9d8-3adc5d0d940b')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     @decorators.attr(type=['negative'])
     def test_resize_server_with_null_flavor(self):
         """Resizing a server with null flavor should fail"""
diff --git a/tempest/api/compute/volumes/test_attach_volume.py b/tempest/api/compute/volumes/test_attach_volume.py
index 7ea8f09..a534a77 100644
--- a/tempest/api/compute/volumes/test_attach_volume.py
+++ b/tempest/api/compute/volumes/test_attach_volume.py
@@ -493,8 +493,9 @@
         self.volumes_client.wait_for_resource_deletion(volume['id'])
 
     @decorators.idempotent_id('f01c7169-a124-4fc7-ae60-5e380e247c9c')
-    @testtools.skipUnless(CONF.compute_feature_enabled.resize,
-                          'Resize not available.')
+    @testtools.skipIf(not (CONF.compute_feature_enabled.cold_migration and
+                           CONF.compute_feature_enabled.resize),
+                      'Cold migration/Resize not available.')
     def test_resize_server_with_multiattached_volume(self):
         """Test resizing servers with multiattached volume