diff --git a/barbican_tempest_plugin/tests/scenario/manager.py b/barbican_tempest_plugin/tests/scenario/manager.py index 1aa009e..66d28a5 100644 --- a/barbican_tempest_plugin/tests/scenario/manager.py +++ b/barbican_tempest_plugin/tests/scenario/manager.py @@ -333,6 +333,7 @@ class ScenarioTest(manager.NetworkScenarioTest): waiters.wait_for_volume_resource_status(self.volumes_client, volume['id'], 'in-use') + self.addCleanup(self.nova_volume_detach, server, volume) # Return the updated volume after the attachment return self.volumes_client.show_volume(volume['id'])['volume'] diff --git a/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py b/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py index 95ba5d5..c2033fb 100644 --- a/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py +++ b/barbican_tempest_plugin/tests/scenario/test_volume_encryption.py @@ -56,7 +56,7 @@ class VolumeEncryptionTest(barbican_manager.BarbicanScenarioTest): def attach_detach_volume(self, server, volume, keypair): # Attach volume - attached_volume = self.nova_volume_attach(server, volume) + self.nova_volume_attach(server, volume) # Write a timestamp to volume server_ip = self.get_server_ip(server) @@ -72,9 +72,6 @@ class VolumeEncryptionTest(barbican_manager.BarbicanScenarioTest): ) self.assertEqual(timestamp, timestamp2) - # Detach volume - self.nova_volume_detach(server, attached_volume) - @decorators.idempotent_id('89165fb4-5534-4b9d-8429-97ccffb8f86f') @utils.services('compute', 'volume', 'image') def test_encrypted_cinder_volumes_luks(self):