Add new rescue compute feature flag
This adds a new feature flag to toggle whether rescue mode is supported by the hypervisor and skips rescue tests accordingly. The feature is enabled by default. Change-Id: I4dabe663a177aac853ea0e6f4b58b28da890be71 Closes-bug: #1331870.
This commit is contained in:
		@@ -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]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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()
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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'
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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?')
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user