Fix test_check_simple_image_attributes to pass with AMI images
Modify the ec2api.tests.functional.api.test_images.ImageTest.test_check_simple_image_attributes test case to allow AMI image types. Change-Id: Idc94f84977dacaf9e2a3d3968288bc4396507fff Closes-Bug: #1710597
This commit is contained in:
parent
775ac72da1
commit
41823a515d
|
@ -212,17 +212,26 @@ class ImageTest(base.EC2TestCase):
|
||||||
@decorators.idempotent_id('b9aba1f7-0a7e-4717-b879-efe3bbea74e2')
|
@decorators.idempotent_id('b9aba1f7-0a7e-4717-b879-efe3bbea74e2')
|
||||||
@testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
|
@testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
|
||||||
def test_check_simple_image_attributes(self):
|
def test_check_simple_image_attributes(self):
|
||||||
|
data = self.client.describe_images(ImageIds=[CONF.aws.ebs_image_id])
|
||||||
|
base_image = data['Images'][0]
|
||||||
|
|
||||||
name = data_utils.rand_name('image')
|
name = data_utils.rand_name('image')
|
||||||
desc = data_utils.rand_name('desc for image')
|
desc = data_utils.rand_name('desc for image')
|
||||||
image_id, image_clean = self._create_image(name, desc)
|
image_id, image_clean = self._create_image(name, desc)
|
||||||
|
|
||||||
data = self.client.describe_image_attribute(
|
data = self.client.describe_image_attribute(
|
||||||
ImageId=image_id, Attribute='kernel')
|
ImageId=image_id, Attribute='kernel')
|
||||||
self.assertNotIn('KernelId', data)
|
if 'KernelId' in base_image:
|
||||||
|
self.assertIn('KernelId', data)
|
||||||
|
else:
|
||||||
|
self.assertNotIn('KernelId', data)
|
||||||
|
|
||||||
data = self.client.describe_image_attribute(
|
data = self.client.describe_image_attribute(
|
||||||
ImageId=image_id, Attribute='ramdisk')
|
ImageId=image_id, Attribute='ramdisk')
|
||||||
self.assertNotIn('RamdiskId', data)
|
if 'RamdiskId' in base_image:
|
||||||
|
self.assertIn('RamdiskId', data)
|
||||||
|
else:
|
||||||
|
self.assertNotIn('RamdiskId', data)
|
||||||
|
|
||||||
# description
|
# description
|
||||||
data = self.client.describe_image_attribute(
|
data = self.client.describe_image_attribute(
|
||||||
|
|
Loading…
Reference in New Issue