Merge "Move suspend_available class variable into skip decorators"
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 72ccc71..4b3551c 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -31,7 +31,6 @@
class ServerActionsTestJSON(base.BaseV2ComputeTest):
resize_available = CONF.compute_feature_enabled.resize
pause_available = CONF.compute_feature_enabled.pause
- suspend_available = CONF.compute_feature_enabled.suspend
run_ssh = CONF.compute.run_ssh
def setUp(self):
@@ -352,7 +351,8 @@
self.assertEqual(202, resp.status)
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
- @testtools.skipIf(not suspend_available, 'Suspend is not available.')
+ @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
+ 'Suspend is not available.')
@test.attr(type='gate')
def test_suspend_resume_server(self):
resp, server = self.client.suspend_server(self.server_id)
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index cbfec5c..dd69d91 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -30,7 +30,6 @@
class ServersNegativeTestJSON(base.BaseV2ComputeTest):
pause_available = CONF.compute_feature_enabled.pause
- suspend_available = CONF.compute_feature_enabled.suspend
def setUp(self):
super(ServersNegativeTestJSON, self).setUp()
@@ -333,7 +332,8 @@
self.client.unpause_server,
self.server_id)
- @testtools.skipIf(not suspend_available, 'Suspend is not available.')
+ @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
+ 'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
def test_suspend_non_existent_server(self):
# suspend a non existent server
@@ -341,7 +341,8 @@
self.assertRaises(exceptions.NotFound, self.client.suspend_server,
nonexistent_server)
- @testtools.skipIf(not suspend_available, 'Suspend is not available.')
+ @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
+ 'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
def test_suspend_server_invalid_state(self):
# suspend a suspended server.
@@ -354,7 +355,8 @@
self.client.suspend_server,
self.server_id)
- @testtools.skipIf(not suspend_available, 'Suspend is not available.')
+ @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
+ 'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
def test_resume_non_existent_server(self):
# resume a non existent server
@@ -362,7 +364,8 @@
self.assertRaises(exceptions.NotFound, self.client.resume_server,
nonexistent_server)
- @testtools.skipIf(not suspend_available, 'Suspend is not available.')
+ @testtools.skipUnless(CONF.compute_feature_enabled.suspend,
+ 'Suspend is not available.')
@test.attr(type=['negative', 'gate'])
def test_resume_server_invalid_state(self):
# resume an active server.