diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-06-28 09:56:48 -0600 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-06-28 09:56:48 -0600 |
commit | 9f7f513321f98f09fcba576f118a3f7d3239262e (patch) | |
tree | d6d20f0f9e44a882be0f0c6898c28ab7db873f6f | |
parent | 2a4dc5493763a241c9895652bf1c71ac3ef0e5b3 (diff) |
Fixed test to not download images when configured with a disk file path.
JIRA: FUNCTEST-809
Change-Id: I078578ba9881eeeb8942d22cb342e87e17f6f879
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
-rw-r--r-- | snaps/openstack/tests/create_image_tests.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/snaps/openstack/tests/create_image_tests.py b/snaps/openstack/tests/create_image_tests.py index cadbe5c..d538fef 100644 --- a/snaps/openstack/tests/create_image_tests.py +++ b/snaps/openstack/tests/create_image_tests.py @@ -619,11 +619,15 @@ class CreateMultiPartImageTests(OSIntegrationTestCase): """ Tests the creation of a 3-part OpenStack image from files. """ + file_only = False + # Set properties properties = {} if self.glance_test_meta: if 'extra_properties' in self.glance_test_meta: properties = self.glance_test_meta['extra_properties'] + if 'disk_file' in self.glance_test_meta: + file_only = True # Create the kernel image kernel_file_name = None @@ -635,9 +639,13 @@ class CreateMultiPartImageTests(OSIntegrationTestCase): else: kernel_url = openstack_tests.CIRROS_DEFAULT_KERNEL_IMAGE_URL - if not kernel_file_name: + if not kernel_file_name and not file_only: kernel_file_name = file_utils.download(kernel_url, self.tmp_dir).name + else: + logger.warn('Will not download the kernel image.' + ' Cannot execute test') + return kernel_file_image_settings = openstack_tests.file_image_test_settings( name=self.image_name + '_kernel', file_path=kernel_file_name) @@ -657,9 +665,13 @@ class CreateMultiPartImageTests(OSIntegrationTestCase): elif 'ramdisk_url' in self.glance_test_meta: ramdisk_url = self.glance_test_meta['ramdisk_url'] - if not ramdisk_file_name: + if not ramdisk_file_name and not file_only: ramdisk_file_name = file_utils.download(ramdisk_url, self.tmp_dir).name + else: + logger.warn('Will not download the ramdisk image.' + ' Cannot execute test') + return ramdisk_file_image_settings = openstack_tests.file_image_test_settings( name=self.image_name + '_ramdisk', file_path=ramdisk_file_name) @@ -678,8 +690,12 @@ class CreateMultiPartImageTests(OSIntegrationTestCase): elif 'disk_url' in self.glance_test_meta: disk_url = self.glance_test_meta['disk_url'] - if not disk_file_name: + if not disk_file_name and not file_only: disk_file_name = file_utils.download(disk_url, self.tmp_dir).name + else: + logger.warn('Will not download the disk file image.' + ' Cannot execute test') + return file_image_settings = openstack_tests.file_image_test_settings( name=self.image_name, file_path=disk_file_name) |