diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample index 9051310ce..f1712ac6a 100644 --- a/etc/tempest.conf.sample +++ b/etc/tempest.conf.sample @@ -424,6 +424,10 @@ # as [nova.rdp]->enabled in nova.conf (boolean value) #rdp_console=false +# Does the test environment support instance rescue mode? +# (boolean value) +#rescue=true + [dashboard] diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py index 093e9e2a6..ab98d881c 100644 --- a/tempest/api/compute/servers/test_server_rescue.py +++ b/tempest/api/compute/servers/test_server_rescue.py @@ -15,14 +15,21 @@ from tempest.api.compute import base from tempest.common.utils import data_utils +from tempest import config from tempest import test +CONF = config.CONF + class ServerRescueTestJSON(base.BaseV2ComputeTest): @classmethod @test.safe_setup def setUpClass(cls): + if not CONF.compute_feature_enabled.rescue: + msg = "Server rescue not available." + raise cls.skipException(msg) + cls.set_network_resources(network=True, subnet=True, router=True) super(ServerRescueTestJSON, cls).setUpClass() diff --git a/tempest/api/compute/servers/test_server_rescue_negative.py b/tempest/api/compute/servers/test_server_rescue_negative.py index dae470992..b35e55c0f 100644 --- a/tempest/api/compute/servers/test_server_rescue_negative.py +++ b/tempest/api/compute/servers/test_server_rescue_negative.py @@ -28,6 +28,10 @@ class ServerRescueNegativeTestJSON(base.BaseV2ComputeTest): @classmethod @test.safe_setup def setUpClass(cls): + if not CONF.compute_feature_enabled.rescue: + msg = "Server rescue not available." + raise cls.skipException(msg) + cls.set_network_resources(network=True, subnet=True, router=True) super(ServerRescueNegativeTestJSON, cls).setUpClass() cls.device = 'vdf' diff --git a/tempest/api/compute/v3/servers/test_server_rescue.py b/tempest/api/compute/v3/servers/test_server_rescue.py index b3dcb51ce..da58f26bc 100644 --- a/tempest/api/compute/v3/servers/test_server_rescue.py +++ b/tempest/api/compute/v3/servers/test_server_rescue.py @@ -14,13 +14,19 @@ # under the License. from tempest.api.compute import base +from tempest import config from tempest import test +CONF = config.CONF + class ServerRescueV3Test(base.BaseV3ComputeTest): @classmethod def setUpClass(cls): + if not CONF.compute_feature_enabled.rescue: + msg = "Server rescue not available." + raise cls.skipException(msg) super(ServerRescueV3Test, cls).setUpClass() # Server for positive tests diff --git a/tempest/api/compute/v3/servers/test_server_rescue_negative.py b/tempest/api/compute/v3/servers/test_server_rescue_negative.py index eb6bcdd74..5eb6c9ad1 100644 --- a/tempest/api/compute/v3/servers/test_server_rescue_negative.py +++ b/tempest/api/compute/v3/servers/test_server_rescue_negative.py @@ -28,6 +28,10 @@ class ServerRescueNegativeV3Test(base.BaseV3ComputeTest): @classmethod @test.safe_setup def setUpClass(cls): + if not CONF.compute_feature_enabled.rescue: + msg = "Server rescue not available." + raise cls.skipException(msg) + super(ServerRescueNegativeV3Test, cls).setUpClass() cls.device = 'vdf' diff --git a/tempest/config.py b/tempest/config.py index e3f0f2ac3..4ea07028d 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -310,7 +310,11 @@ ComputeFeaturesGroup = [ cfg.BoolOpt('rdp_console', default=False, help='Enable RDP console. This configuration value should ' - 'be same as [nova.rdp]->enabled in nova.conf') + 'be same as [nova.rdp]->enabled in nova.conf'), + cfg.BoolOpt('rescue', + default=True, + help='Does the test environment support instance rescue ' + 'mode?') ]