Tests: Fix double mocking in test_rbd

This was triggering unit test failures in
cinder.tests.unit.volume.test_volume.VolumeTestCase.
test_create_volume_from_volume_with_enc_2, presumably
because the double mocking broke cleanup here.

Change-Id: I97d1a54b849c99621fa17be47fb147e83dd8806f
This commit is contained in:
Eric Harney 2024-10-25 12:14:01 -04:00
parent a357d009fa
commit e1c8131152

@ -1846,11 +1846,8 @@ class RBDTestCase(test.TestCase):
self.driver.copy_image_to_volume(*args)
@mock.patch('cinder.volume.drivers.rbd.fileutils.delete_if_exists')
@mock.patch('cinder.volume.volume_utils.check_encryption_provider',
return_value={'encryption_key_id': fake.ENCRYPTION_KEY_ID})
@mock.patch('cinder.image.image_utils.convert_image')
def _copy_image_encrypted(self, mock_convert, mock_encrypt_key,
mock_temp_delete):
def _copy_image_encrypted(self, mock_convert, mock_temp_delete):
key_mgr = fake_keymgr.fake_api()
self.mock_object(castellan.key_manager, 'API', return_value=key_mgr)
key_id = key_mgr.store(self.context, KeyObject())