diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-07-20 11:08:31 -0600 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-07-24 09:07:31 -0600 |
commit | 8b52c661d1c80828690831cfb8636ec2835fc379 (patch) | |
tree | b3605694e0019faefe1df35da26d37d53fc6a526 /snaps/openstack/tests | |
parent | 8e9920d2e8bd4a3d404b4589312cdc9510708a37 (diff) |
Fixed potential problems with image creation exceptions.
With Glance client v2, it appears that rolling back on image
creation error was sending in an OpenStack image object into
the delete_image() function where it should have been expecting
a SNAPS-OO Image domain object.
Also added log messages to help expose other potential issues
if this patch does not address the root problem at hand.
JIRA: SNAPS-139
Change-Id: I52591ff1d055ddf4eacbbc49b3bc8718285edcfa
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/tests')
-rw-r--r-- | snaps/openstack/tests/create_image_tests.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/snaps/openstack/tests/create_image_tests.py b/snaps/openstack/tests/create_image_tests.py index 6c9b175..5fb39dc 100644 --- a/snaps/openstack/tests/create_image_tests.py +++ b/snaps/openstack/tests/create_image_tests.py @@ -524,6 +524,22 @@ class CreateImageNegativeTests(OSIntegrationTestCase): except Exception as e: self.fail('Invalid Exception ' + str(e)) + def test_bad_image_image_type(self): + """ + Expect an ImageCreationError when the image type bad + """ + os_image_settings = openstack_tests.cirros_image_settings( + name=self.image_name) + self.image_creator = create_image.OpenStackImage( + self.os_creds, + create_image.ImageSettings(name=os_image_settings.name, + image_user=os_image_settings.image_user, + img_format='foo', + url=os_image_settings.url)) + + with self.assertRaises(Exception): + self.image_creator.create() + def test_bad_image_file(self): """ Expect an ImageCreationError when the image file does not exist |