Merge "Support disabling suspend/resume for compute api"

This commit is contained in:
Jenkins
2014-03-22 00:05:53 +00:00
committed by Gerrit Code Review
4 changed files with 14 additions and 0 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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.

View File

@@ -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 "