From e295740c719ff8057ed98c90637c50a14d1b3935 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 22 Aug 2017 22:53:57 +0200 Subject: Complete caching images for vnf testcases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It conforms with snaps API for publishing local images. It completes [1] which only modifies the yaml files. [1] https://gerrit.opnfv.org/gerrit/#/c/39757/ Change-Id: I325a245c0e7bb15bb1f9570996500573cfe257b0 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/vnf/ims/cloudify_ims.py | 8 ++++---- functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py | 12 +++++------- functest/opnfv_tests/vnf/ims/orchestra_openims.py | 11 +++++------ 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index 8f6fcec89..b07eaee23 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -110,15 +110,15 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): # needs some images self.__logger.info("Upload some OS images if it doesn't exist") - for image_name, image_url in self.images.iteritems(): - self.__logger.info("image: %s, url: %s", image_name, image_url) - if image_url and image_name: + for image_name, image_file in self.images.iteritems(): + self.__logger.info("image: %s, file: %s", image_name, image_file) + if image_file and image_name: image_creator = OpenStackImage( self.snaps_creds, ImageSettings(name=image_name, image_user='cloud', img_format='qcow2', - url=image_url)) + image_file=image_file)) image_creator.create() # self.created_object.append(image_creator) diff --git a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py index 9e14711c1..a54059966 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py @@ -195,9 +195,7 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): if not os.path.exists(self.data_dir): os.makedirs(self.data_dir) - self.images = get_config( - "tenant_images.%s" % - self.case_name, config_file) + self.images = get_config("tenant_images.orchestrator", config_file) self.images.update( get_config( "tenant_images.%s" % @@ -228,15 +226,15 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): def prepare_images(self): """Upload images if they doen't exist yet""" self.logger.info("Upload images if they doen't exist yet") - for image_name, image_url in self.images.iteritems(): - self.logger.info("image: %s, url: %s", image_name, image_url) - if image_url and image_name: + for image_name, image_file in self.images.iteritems(): + self.logger.info("image: %s, file: %s", image_name, image_file) + if image_file and image_name: image = OpenStackImage( self.snaps_creds, ImageSettings(name=image_name, image_user='cloud', img_format='qcow2', - url=image_url)) + image_file=image_file)) image.create() # self.created_resources.append(image); diff --git a/functest/opnfv_tests/vnf/ims/orchestra_openims.py b/functest/opnfv_tests/vnf/ims/orchestra_openims.py index f9a81f225..f8acada44 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_openims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_openims.py @@ -195,8 +195,7 @@ class OpenImsVnf(vnf.VnfOnBoarding): if not os.path.exists(self.data_dir): os.makedirs(self.data_dir) - self.images = get_config("tenant_images.%s" % - self.case_name, config_file) + self.images = get_config("tenant_images.orchestrator", config_file) self.images.update(get_config("tenant_images.%s" % self.case_name, config_file)) self.snaps_creds = None @@ -224,15 +223,15 @@ class OpenImsVnf(vnf.VnfOnBoarding): def prepare_images(self): """Upload images if they doen't exist yet""" self.logger.info("Upload images if they doen't exist yet") - for image_name, image_url in self.images.iteritems(): - self.logger.info("image: %s, url: %s", image_name, image_url) - if image_url and image_name: + for image_name, image_file in self.images.iteritems(): + self.logger.info("image: %s, file: %s", image_name, image_file) + if image_file and image_name: image = OpenStackImage( self.snaps_creds, ImageSettings(name=image_name, image_user='cloud', img_format='qcow2', - url=image_url)) + image_file=image_file)) image.create() # self.created_resources.append(image); -- cgit 1.2.3-korg