Distinguish between luks and cryptsetup volume types

TestEncryptedCinderVolumes was always creating the volume type in cinder
with a random name but 'luks' was always in the name since it's
hard-coded, which makes debugging failures in the cryptsetup test
difficult when you're looking at nova-compute logs.

Change the helper method to take a parameter for the volume type name
so we can distinguish between luks and cryptsetup.

Related-Bug: #1327218

Change-Id: If607ba6d389e6a482cfb1eb3af4fe895ed00f8db
This commit is contained in:
Matt Riedemann 2015-03-13 09:50:25 -07:00
parent 8c58227b82
commit cd2872ae27
1 changed files with 6 additions and 4 deletions

View File

@ -35,8 +35,8 @@ class TestEncryptedCinderVolumes(manager.EncryptionScenarioTest):
self.glance_image_create()
self.nova_boot()
def create_encrypted_volume(self, encryption_provider):
volume_type = self.create_volume_type(name='luks')
def create_encrypted_volume(self, encryption_provider, volume_type):
volume_type = self.create_volume_type(name=volume_type)
self.create_encryption_type(type_id=volume_type['id'],
provider=encryption_provider,
key_size=512,
@ -53,7 +53,8 @@ class TestEncryptedCinderVolumes(manager.EncryptionScenarioTest):
def test_encrypted_cinder_volumes_luks(self):
self.launch_instance()
self.create_encrypted_volume('nova.volume.encryptors.'
'luks.LuksEncryptor')
'luks.LuksEncryptor',
volume_type='luks')
self.attach_detach_volume()
@test.idempotent_id('cbc752ed-b716-4717-910f-956cce965722')
@ -61,5 +62,6 @@ class TestEncryptedCinderVolumes(manager.EncryptionScenarioTest):
def test_encrypted_cinder_volumes_cryptsetup(self):
self.launch_instance()
self.create_encrypted_volume('nova.volume.encryptors.'
'cryptsetup.CryptsetupEncryptor')
'cryptsetup.CryptsetupEncryptor',
volume_type='cryptsetup')
self.attach_detach_volume()