Set scenario.img_file from the name of the image
After https://review.openstack.org/#/c/524156/, the name of the image image saved locally does not match anymore the default value of scenario.img_file, but the name of the downloaded file. If those two values are different, as it is likely to happen every time that a specific image is passed, the scenario tests and everything else that use ScenarioTest.glance_image_create() fail. Setting the property so that it matches the file name solves the issue. Change-Id: I44936418ce359eaf04c4f47f0961687d65d45c6c
This commit is contained in:
parent
e99569419c
commit
e61aa57609
@ -836,6 +836,7 @@ def create_tempest_images(client, conf, image_path, allow_creation,
|
||||
img_path = os.path.join(conf.get("scenario", "img_dir"),
|
||||
os.path.basename(image_path))
|
||||
name = image_path[image_path.rfind('/') + 1:]
|
||||
conf.set('scenario', 'img_file', name)
|
||||
alt_name = name + "_alt"
|
||||
image_id = None
|
||||
if conf.has_option('compute', 'image_ref'):
|
||||
|
@ -27,7 +27,7 @@ class TestCreateTempestImages(BaseConfigTempestTest):
|
||||
super(TestCreateTempestImages, self).setUp()
|
||||
self.conf = self._get_conf("v2.0", "v3")
|
||||
self.client = self._get_clients(self.conf).images
|
||||
self.image_path = "my_path"
|
||||
self.image_path = "my_path/my_image.qcow2"
|
||||
self.allow_creation = False
|
||||
self.disk_format = ".format"
|
||||
self.dir = "/img/"
|
||||
@ -55,6 +55,8 @@ class TestCreateTempestImages(BaseConfigTempestTest):
|
||||
disk_format=self.disk_format)
|
||||
self.assertEqual(self.conf.get('compute', 'image_ref'), 'id_c')
|
||||
self.assertEqual(self.conf.get('compute', 'image_ref_alt'), 'id_d')
|
||||
self.assertEqual(self.conf.get('scenario', 'img_file'),
|
||||
'my_image.qcow2')
|
||||
|
||||
def test_create_tempest_images_ref_alt_ref(self):
|
||||
self.conf.set('compute', 'image_ref', 'id_a')
|
||||
|
Loading…
x
Reference in New Issue
Block a user