Skip unsupported cryptoproviders tests in tempest
Related-Prod: PRODX-26237
Change-Id: Ia7dcce95c4b500adad07ea21005e4503a58893cc
(cherry picked from commit 3f437f883c517ffbbabf5f3c7f3e3f94de3e09db)
diff --git a/tempest/config.py b/tempest/config.py
index 2e02294..7fd6e64 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1155,7 +1155,10 @@
cfg.BoolOpt('instance_locality_enabled',
default=False,
help='The boolean flag to run instance locality tests '
- 'on environment.')
+ 'on environment.'),
+ cfg.ListOpt('supported_crypto_providers',
+ default=['luks'],
+ help='A list of enabled cryptoproviders for volumes'),
]
diff --git a/tempest/scenario/test_encrypted_cinder_volumes.py b/tempest/scenario/test_encrypted_cinder_volumes.py
index a45fdf6..3e354dc 100644
--- a/tempest/scenario/test_encrypted_cinder_volumes.py
+++ b/tempest/scenario/test_encrypted_cinder_volumes.py
@@ -55,6 +55,9 @@
@decorators.idempotent_id('79165fb4-5534-4b9d-8429-97ccffb8f86e')
@decorators.attr(type='slow')
+ @testtools.skipUnless(
+ 'luks' in CONF.volume_feature_enabled.supported_crypto_providers,
+ 'luks cryptoprovider is not supported.')
@utils.services('compute', 'volume', 'image')
def test_encrypted_cinder_volumes_luks(self):
"""LUKs v1 decrypts volume through libvirt."""
@@ -77,6 +80,9 @@
@decorators.idempotent_id('cbc752ed-b716-4717-910f-956cce965722')
@decorators.attr(type='slow')
+ @testtools.skipUnless(
+ 'plain' in CONF.volume_feature_enabled.supported_crypto_providers,
+ 'plain cryptoprovider is not supported.')
@utils.services('compute', 'volume', 'image')
def test_encrypted_cinder_volumes_cryptsetup(self):
server = self.launch_instance()
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index cdb3ef4..5d32ca2 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -266,6 +266,9 @@
@decorators.idempotent_id('cb78919a-e553-4bab-b73b-10cf4d2eb125')
@testtools.skipUnless(CONF.compute_feature_enabled.attach_encrypted_volume,
'Encrypted volume attach is not supported')
+ @testtools.skipUnless(
+ 'luks' in CONF.volume_feature_enabled.supported_crypto_providers,
+ 'luks cryptoprovider is not supported.')
@utils.services('compute', 'volume')
def test_boot_server_from_encrypted_volume_luks(self):
"""LUKs v1 decrypts volume through libvirt."""
@@ -278,6 +281,9 @@
'Ceph only supports LUKSv2 if doing host attach.')
@testtools.skipUnless(CONF.compute_feature_enabled.attach_encrypted_volume,
'Encrypted volume attach is not supported')
+ @testtools.skipUnless(
+ 'luks2' in CONF.volume_feature_enabled.supported_crypto_providers,
+ 'luks2 cryptoprovider is not supported.')
@utils.services('compute', 'volume')
def test_boot_server_from_encrypted_volume_luksv2(self):
"""LUKs v2 decrypts volume through os-brick."""