Unhardcode encrypted volume types names
Introduce the foolowing options that allows to change volume type names:
* volume_type_cryptsetup
* volume_type_luks
* volume_type_luks_v2
Related-Prod: PRODX-25629
Change-Id: I1ceb26e5a45f1140f6908250d9950594e2561de3
diff --git a/tempest/config.py b/tempest/config.py
index f473f75..2e02294 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1092,6 +1092,18 @@
cfg.ListOpt('scheduler_default_filters',
default=[],
help="The list of enabled scheduler filters.",),
+ cfg.StrOpt('volume_type_luks',
+ default='luks',
+ help="The name of volume type used by tests to create"
+ "volumes with luks encryption.",),
+ cfg.StrOpt('volume_type_luks_v2',
+ default='luks2',
+ help="The name of volume type used by tests to create"
+ "volumes with luks v2 encryption.",),
+ cfg.StrOpt('volume_type_cryptsetup',
+ default='cryptsetup',
+ help="The name of volume type used by tests to create"
+ "volumes with cryptsetup encryption.",),
]
volume_feature_group = cfg.OptGroup(name='volume-feature-enabled',
diff --git a/tempest/scenario/test_encrypted_cinder_volumes.py b/tempest/scenario/test_encrypted_cinder_volumes.py
index 9788e19..a45fdf6 100644
--- a/tempest/scenario/test_encrypted_cinder_volumes.py
+++ b/tempest/scenario/test_encrypted_cinder_volumes.py
@@ -59,8 +59,8 @@
def test_encrypted_cinder_volumes_luks(self):
"""LUKs v1 decrypts volume through libvirt."""
server = self.launch_instance()
- volume = self.create_encrypted_volume('luks',
- volume_type='luks')
+ volume = self.create_encrypted_volume(
+ 'luks', volume_type=CONF.volume.volume_type_luks)
self.attach_detach_volume(server, volume)
@decorators.idempotent_id('7abec0a3-61a0-42a5-9e36-ad3138fb38b4')
@@ -80,6 +80,6 @@
@utils.services('compute', 'volume', 'image')
def test_encrypted_cinder_volumes_cryptsetup(self):
server = self.launch_instance()
- volume = self.create_encrypted_volume('plain',
- volume_type='cryptsetup')
+ volume = self.create_encrypted_volume(
+ 'plain', volume_type=CONF.volume.volume_type_cryptsetup)
self.attach_detach_volume(server, volume)
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 2e87c15..cdb3ef4 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -269,7 +269,9 @@
@utils.services('compute', 'volume')
def test_boot_server_from_encrypted_volume_luks(self):
"""LUKs v1 decrypts volume through libvirt."""
- self._do_test_boot_server_from_encrypted_volume_luks('luks')
+ self._do_test_boot_server_from_encrypted_volume_luks(
+ CONF.volume.volume_type_luks
+ )
@decorators.idempotent_id('5ab6100f-1b31-4dd0-a774-68cfd837ef77')
@testtools.skipIf(CONF.volume.storage_protocol == 'ceph',
@@ -279,4 +281,6 @@
@utils.services('compute', 'volume')
def test_boot_server_from_encrypted_volume_luksv2(self):
"""LUKs v2 decrypts volume through os-brick."""
- self._do_test_boot_server_from_encrypted_volume_luks('luks2')
+ self._do_test_boot_server_from_encrypted_volume_luks(
+ CONF.volume.volume_type_luks_v2
+ )