api.test_images.ImageTest.test_check_simple_image_attributes fails with AMI test image

Bug #1710597 reported by Stefan Nica
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ec2-api
Fix Released
Undecided
Unassigned

Bug Description

The api.test_images.ImageTest.test_check_simple_image_attributes test case fails if an AMI type image is used as the test image because it doesn't expect to find any kernel/ramdisk references in the newly created images:

    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/ec2api/tests/functional/api/test_images.py", line 222, in test_check_simple_image_attributes
        self.assertNotIn('KernelId', data)
      File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 455, in assertNotIn
        self.assertThat(haystack, matcher, message)
      File "/usr/lib/python2.7/site-packages/testtools/testcase.py", line 498, in assertThat
        raise mismatch_error
    testtools.matchers._impl.MismatchError: {u'KernelId': {u'Value': 'aki-3a217fcc'}, 'ResponseMetadata': {'RetryAttempts': 0, 'HTTPStatusCode': 200, 'RequestId': 'req-8849cab1-3891-4571-ae7f-0793a49a3200', 'HTTPHeaders': {'date': 'Mon, 14 Aug 2017 10:06:50 GMT', 'content-length': '271', 'content-type': 'text/xml'}}, u'ImageId': 'ami-017e8511'} matches Contains('KernelId')

The test case should be updated to also allow for AMI image types to be used.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ec2-api (master)

Reviewed: https://review.openstack.org/493510
Committed: https://git.openstack.org/cgit/openstack/ec2-api/commit/?id=41823a515dfe2e8eac32c5f23ef722042533be0d
Submitter: Jenkins
Branch: master

commit 41823a515dfe2e8eac32c5f23ef722042533be0d
Author: Stefan Nica <email address hidden>
Date: Mon Aug 14 12:55:42 2017 +0200

    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

Changed in ec2-api:
status: New → Fix Released
Revision history for this message
Andrey Pavlov (apavlov-e) wrote :

Hi Stefan,

As from Amazon documentation these attrbutes only applicable to machine image - http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Image.html

But this test requires EBS image.

If all other tests for EBS image are passed how you achieve that this test is failed?

Revision history for this message
Stefan Nica (stefan.nica) wrote :

Hi Andrey,

I agree, this test does require an EBS image and these attributes are indeed only applicable to machine image. However, what's not so obvious is that EBS images ARE machine images. The thing that differentiates them as EBS images is that they have an EBS root device type (see the rootDeviceType field).

You're right about the documentation: it specifies that the ImageType field can take the values: "machine", "ramdisk" and "kernel", so yes, it makes sense that the KernelId and RamdiskId are not applicable to "kernel" and "ramdisk" type images. This doesn't say anything about EBS images not being able to have references to kernel/ramdisk images.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ec2-api (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/493798

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ec2-api (stable/ocata)

Reviewed: https://review.openstack.org/493798
Committed: https://git.openstack.org/cgit/openstack/ec2-api/commit/?id=5a4305eb42221ba67c33678b2a590b3e028784e1
Submitter: Jenkins
Branch: stable/ocata

commit 5a4305eb42221ba67c33678b2a590b3e028784e1
Author: Stefan Nica <email address hidden>
Date: Mon Aug 14 12:55:42 2017 +0200

    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
    (cherry picked from commit 41823a515dfe2e8eac32c5f23ef722042533be0d)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ec2-api 7.0.0

This issue was fixed in the openstack/ec2-api 7.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ec2-api ocata-eol

This issue was fixed in the openstack/ec2-api ocata-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.