Skip unsupported cryptoproviders tests in tempest
Related-Prod: PRODX-26237
Change-Id: Ia7dcce95c4b500adad07ea21005e4503a58893cc
(cherry picked from commit 3f437f883c517ffbbabf5f3c7f3e3f94de3e09db)
(cherry picked from commit cb5fdcb4061483a99617fba3baa9a158ce454e37)
diff --git a/tempest/config.py b/tempest/config.py
index ae065ef..348ecdf 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1108,7 +1108,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 753e64f..4cc9e9c 100644
--- a/tempest/scenario/test_encrypted_cinder_volumes.py
+++ b/tempest/scenario/test_encrypted_cinder_volumes.py
@@ -54,6 +54,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."""
@@ -90,6 +93,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):
volume = self.create_encrypted_volume('plain',
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 5e28ecd..46b2f4b 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -276,6 +276,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."""
@@ -286,6 +289,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."""