From d2bf2e00eaedb5113f4baee3a707aa026dd1c18d Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sun, 24 Jun 2018 11:37:10 +0200 Subject: Improve scenarios to reduce duplicate codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I71f79b9ac8314ac979d4b1009f662baa7c93a4fd Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/tempest/tempest.py | 27 ++++------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'functest/opnfv_tests/openstack/tempest/tempest.py') diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index 2fa3bd609..baa7e14fc 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -266,31 +266,12 @@ class TempestCommon(singlevm.VmReady1): compute_cnt = len(self.cloud.list_hypervisors()) LOGGER.info("Creating two images for Tempest suite") - - self.image_alt = self.cloud.create_image( - '{}-img_alt_{}'.format(self.case_name, self.guid), - filename=getattr( - config.CONF, '{}_image'.format(self.case_name), - self.filename), - meta=getattr( - config.CONF, '{}_extra_properties'.format(self.case_name), - self.extra_properties), - visibility=getattr( - config.CONF, '{}_visibility'.format(self.case_name), - self.visibility)) + self.image_alt = self.publish_image( + '{}-img_alt_{}'.format(self.case_name, self.guid)) LOGGER.debug("image_alt: %s", self.image_alt) - - self.flavor_alt = self.orig_cloud.create_flavor( - '{}-flavor_alt_{}'.format(self.case_name, self.guid), - getattr(config.CONF, '{}_flavor_ram'.format(self.case_name), - self.flavor_ram), - getattr(config.CONF, '{}_flavor_vcpus'.format(self.case_name), - self.flavor_vcpus), - getattr(config.CONF, '{}_flavor_disk'.format(self.case_name), - self.flavor_disk)) + self.flavor_alt = self.create_flavor( + '{}-flavor_alt_{}'.format(self.case_name, self.guid)) LOGGER.debug("flavor: %s", self.flavor_alt) - self.orig_cloud.set_flavor_specs( - self.flavor_alt.id, getattr(config.CONF, 'flavor_extra_specs', {})) self.conf_file = conf_utils.configure_verifier(self.deployment_dir) conf_utils.configure_tempest_update_params( -- cgit 1.2.3-korg