Merge "Support disabling suspend/resume for compute api"
This commit is contained in:
@@ -350,6 +350,10 @@
|
|||||||
# Does the test environment support pausing? (boolean value)
|
# Does the test environment support pausing? (boolean value)
|
||||||
#pause=true
|
#pause=true
|
||||||
|
|
||||||
|
# Does the test environment support suspend/resume? (boolean
|
||||||
|
# value)
|
||||||
|
#suspend=true
|
||||||
|
|
||||||
# Does the test environment support live migration available?
|
# Does the test environment support live migration available?
|
||||||
# (boolean value)
|
# (boolean value)
|
||||||
#live_migration=false
|
#live_migration=false
|
||||||
|
@@ -32,6 +32,7 @@ CONF = config.CONF
|
|||||||
class ServerActionsTestJSON(base.BaseV2ComputeTest):
|
class ServerActionsTestJSON(base.BaseV2ComputeTest):
|
||||||
resize_available = CONF.compute_feature_enabled.resize
|
resize_available = CONF.compute_feature_enabled.resize
|
||||||
pause_available = CONF.compute_feature_enabled.pause
|
pause_available = CONF.compute_feature_enabled.pause
|
||||||
|
suspend_available = CONF.compute_feature_enabled.suspend
|
||||||
run_ssh = CONF.compute.run_ssh
|
run_ssh = CONF.compute.run_ssh
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@@ -362,6 +363,7 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
|
|||||||
self.assertEqual(202, resp.status)
|
self.assertEqual(202, resp.status)
|
||||||
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
|
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
|
||||||
|
|
||||||
|
@testtools.skipIf(not suspend_available, 'Suspend is not available.')
|
||||||
@test.attr(type='gate')
|
@test.attr(type='gate')
|
||||||
def test_suspend_resume_server(self):
|
def test_suspend_resume_server(self):
|
||||||
resp, server = self.client.suspend_server(self.server_id)
|
resp, server = self.client.suspend_server(self.server_id)
|
||||||
|
@@ -30,6 +30,7 @@ CONF = config.CONF
|
|||||||
|
|
||||||
class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
||||||
pause_available = CONF.compute_feature_enabled.pause
|
pause_available = CONF.compute_feature_enabled.pause
|
||||||
|
suspend_available = CONF.compute_feature_enabled.suspend
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(ServersNegativeTestJSON, self).setUp()
|
super(ServersNegativeTestJSON, self).setUp()
|
||||||
@@ -332,6 +333,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
self.client.unpause_server,
|
self.client.unpause_server,
|
||||||
self.server_id)
|
self.server_id)
|
||||||
|
|
||||||
|
@testtools.skipIf(not suspend_available, 'Suspend is not available.')
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_suspend_non_existent_server(self):
|
def test_suspend_non_existent_server(self):
|
||||||
# suspend a non existent server
|
# suspend a non existent server
|
||||||
@@ -339,6 +341,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
self.assertRaises(exceptions.NotFound, self.client.suspend_server,
|
self.assertRaises(exceptions.NotFound, self.client.suspend_server,
|
||||||
nonexistent_server)
|
nonexistent_server)
|
||||||
|
|
||||||
|
@testtools.skipIf(not suspend_available, 'Suspend is not available.')
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_suspend_server_invalid_state(self):
|
def test_suspend_server_invalid_state(self):
|
||||||
# suspend a suspended server.
|
# suspend a suspended server.
|
||||||
@@ -351,6 +354,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
self.client.suspend_server,
|
self.client.suspend_server,
|
||||||
self.server_id)
|
self.server_id)
|
||||||
|
|
||||||
|
@testtools.skipIf(not suspend_available, 'Suspend is not available.')
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_resume_non_existent_server(self):
|
def test_resume_non_existent_server(self):
|
||||||
# resume a non existent server
|
# resume a non existent server
|
||||||
@@ -358,6 +362,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
|||||||
self.assertRaises(exceptions.NotFound, self.client.resume_server,
|
self.assertRaises(exceptions.NotFound, self.client.resume_server,
|
||||||
nonexistent_server)
|
nonexistent_server)
|
||||||
|
|
||||||
|
@testtools.skipIf(not suspend_available, 'Suspend is not available.')
|
||||||
@test.attr(type=['negative', 'gate'])
|
@test.attr(type=['negative', 'gate'])
|
||||||
def test_resume_server_invalid_state(self):
|
def test_resume_server_invalid_state(self):
|
||||||
# resume an active server.
|
# resume an active server.
|
||||||
|
@@ -252,6 +252,9 @@ ComputeFeaturesGroup = [
|
|||||||
cfg.BoolOpt('pause',
|
cfg.BoolOpt('pause',
|
||||||
default=True,
|
default=True,
|
||||||
help="Does the test environment support pausing?"),
|
help="Does the test environment support pausing?"),
|
||||||
|
cfg.BoolOpt('suspend',
|
||||||
|
default=True,
|
||||||
|
help="Does the test environment support suspend/resume?"),
|
||||||
cfg.BoolOpt('live_migration',
|
cfg.BoolOpt('live_migration',
|
||||||
default=False,
|
default=False,
|
||||||
help="Does the test environment support live migration "
|
help="Does the test environment support live migration "
|
||||||
|
Reference in New Issue
Block a user