diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample index 6655d5a4c5..761a07748c 100644 --- a/etc/tempest.conf.sample +++ b/etc/tempest.conf.sample @@ -350,6 +350,10 @@ # Does the test environment support pausing? (boolean value) #pause=true +# Does the test environment support suspend/resume? (boolean +# value) +#suspend=true + # Does the test environment support live migration available? # (boolean value) #live_migration=false diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py index b8be5f3bcb..26a75a233d 100644 --- a/tempest/api/compute/servers/test_server_actions.py +++ b/tempest/api/compute/servers/test_server_actions.py @@ -32,6 +32,7 @@ CONF = config.CONF 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): @@ -362,6 +363,7 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest): self.assertEqual(202, resp.status) self.client.wait_for_server_status(self.server_id, 'ACTIVE') + @testtools.skipIf(not suspend_available, '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 b05fc127a8..cbfec5c716 100644 --- a/tempest/api/compute/servers/test_servers_negative.py +++ b/tempest/api/compute/servers/test_servers_negative.py @@ -30,6 +30,7 @@ CONF = config.CONF 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() @@ -332,6 +333,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest): self.client.unpause_server, self.server_id) + @testtools.skipIf(not suspend_available, 'Suspend is not available.') @test.attr(type=['negative', 'gate']) def test_suspend_non_existent_server(self): # suspend a non existent server @@ -339,6 +341,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest): self.assertRaises(exceptions.NotFound, self.client.suspend_server, nonexistent_server) + @testtools.skipIf(not suspend_available, 'Suspend is not available.') @test.attr(type=['negative', 'gate']) def test_suspend_server_invalid_state(self): # suspend a suspended server. @@ -351,6 +354,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest): self.client.suspend_server, self.server_id) + @testtools.skipIf(not suspend_available, 'Suspend is not available.') @test.attr(type=['negative', 'gate']) def test_resume_non_existent_server(self): # resume a non existent server @@ -358,6 +362,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest): self.assertRaises(exceptions.NotFound, self.client.resume_server, nonexistent_server) + @testtools.skipIf(not suspend_available, 'Suspend is not available.') @test.attr(type=['negative', 'gate']) def test_resume_server_invalid_state(self): # resume an active server. diff --git a/tempest/config.py b/tempest/config.py index 801fcdf794..b0945bb417 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -252,6 +252,9 @@ ComputeFeaturesGroup = [ cfg.BoolOpt('pause', default=True, help="Does the test environment support pausing?"), + cfg.BoolOpt('suspend', + default=True, + help="Does the test environment support suspend/resume?"), cfg.BoolOpt('live_migration', default=False, help="Does the test environment support live migration "