Add wait for active image status
To be sure that image is ready to create volume with it, add wait for image status. Also make image public and set name to it. Closes-Bug: #1507987 Change-Id: Ibb87e692a2b0ee36d220d107e2ae9ba500485eab
This commit is contained in:
parent
8e8f21fed9
commit
d5c1aad12f
|
@ -379,7 +379,8 @@ class OpenStackActions(common.Common):
|
|||
def create_image(self, **kwargs):
|
||||
image = self.glance.images.create(**kwargs)
|
||||
logger.info("Created image: '{0}'".format(image.id))
|
||||
return self.glance.images.get(image.id)
|
||||
logger.info("Image status: '{0}'".format(image.status))
|
||||
return image
|
||||
|
||||
def get_image_list(self):
|
||||
return self.glance.images.list()
|
||||
|
|
|
@ -118,7 +118,12 @@ class CephCompact(TestBasic):
|
|||
image_data = BytesIO(bytearray(self.__class__.__name__))
|
||||
image = os_conn.create_image(disk_format='raw',
|
||||
container_format='bare',
|
||||
name='test_ceph_cinder_cow',
|
||||
is_public=True,
|
||||
data=image_data)
|
||||
wait(lambda: os_conn.get_image(image.name).status == 'active',
|
||||
timeout=60 * 2, timeout_msg='Image is not active')
|
||||
|
||||
volume = os_conn.create_volume(size=1, image_id=image.id)
|
||||
|
||||
with self.fuel_web.get_ssh_for_node('slave-01') as remote:
|
||||
|
|
Loading…
Reference in New Issue