summaryrefslogtreecommitdiff
path: root/oslo_vmware/tests
diff options
context:
space:
mode:
authorRajat Dhasmana <rajatdhasmana@gmail.com>2020-03-06 07:53:27 +0000
committerRajat Dhasmana <rajatdhasmana@gmail.com>2020-03-06 07:59:45 +0000
commit74aeac3c5c24396563a7f6c74d9733c05d30ed99 (patch)
treefd7f45e6080379148d793b2daeced0b4067dd3c0 /oslo_vmware/tests
parentcb40fac97296d431a32585cf40ef5ef80e8e9075 (diff)
downloadoslo-vmware-74aeac3c5c24396563a7f6c74d9733c05d30ed99.tar.gz
Pass "base_image_ref" to backend when transfer volume to image
Cinder has a current implementation to support glance colocation of volume images[1]. To support this feature for vmdk driver, we need to pass the base image reference (from which the volume was originally created) to the image service update method which this patch addresses. [1] https://review.opendev.org/#/c/697636/ Change-Id: Iba7cbdd3f50877d360201391e87f1748433348a7
Diffstat (limited to 'oslo_vmware/tests')
-rw-r--r--oslo_vmware/tests/test_image_transfer.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/oslo_vmware/tests/test_image_transfer.py b/oslo_vmware/tests/test_image_transfer.py
index 0bb61b7..436671e 100644
--- a/oslo_vmware/tests/test_image_transfer.py
+++ b/oslo_vmware/tests/test_image_transfer.py
@@ -373,6 +373,7 @@ class ImageTransferUtilityTest(base.TestCase):
image_name = 'fake_image'
image_version = 1
store_id = 'fake_store'
+ base_image_ref = 'e79161cd-5f9d-4007-8823-81a807a64332'
fake_VmdkReadHandle = mock.Mock()
fake_rw_handles_VmdkReadHandle.return_value = fake_VmdkReadHandle
@@ -391,7 +392,8 @@ class ImageTransferUtilityTest(base.TestCase):
is_public=is_public,
image_name=image_name,
image_version=image_version,
- store_id=store_id)
+ store_id=store_id,
+ base_image_ref=base_image_ref)
fake_rw_handles_VmdkReadHandle.assert_called_once_with(session,
host,
@@ -407,8 +409,10 @@ class ImageTransferUtilityTest(base.TestCase):
'vmware_disktype': 'streamOptimized',
'owner_id': owner_id}}
- image_service.update.assert_called_once_with(context,
- image_id,
- image_metadata,
- data=fake_VmdkReadHandle,
- store_id=store_id)
+ image_service.update.assert_called_once_with(
+ context,
+ image_id,
+ image_metadata,
+ data=fake_VmdkReadHandle,
+ store_id=store_id,
+ base_image_ref=base_image_ref)