X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Fopnfv_tests%2Fvnf%2Fims%2Forchestra_clearwaterims.py;h=944d50abe2faaadabc4f2bda466c5d155185e874;hb=refs%2Fchanges%2F93%2F43693%2F4;hp=c1b88c669aee00bf1aae04f14ccf3387f3dcdced;hpb=578f831fe90f08028c6e88e103175b9bb698b6c5;p=functest.git diff --git a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py index c1b88c669..944d50abe 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py @@ -130,6 +130,8 @@ def get_userdata(orchestrator=dict): orchestrator['gvnfm']['userdata']['url']) userdata += "sed -i '113i"'\ \ \ \ '"sleep 60' " \ "/etc/openbaton/openbaton-vnfm-generic-user-data.sh\n" + userdata += ("sed -i s/nfvo.marketplace.port=8082/nfvo.marketplace." + "port=8080/g /etc/openbaton/openbaton-nfvo.properties\n") userdata += "echo \"Starting NFVO\"\n" userdata += "service openbaton-nfvo restart\n" userdata += "echo \"Starting Generic VNFM\"\n" @@ -141,13 +143,13 @@ def get_userdata(orchestrator=dict): class ClearwaterImsVnf(vnf.VnfOnBoarding): """Clearwater IMS VNF deployed with openBaton orchestrator""" - logger = logging.getLogger(__name__) + # logger = logging.getLogger(__name__) def __init__(self, **kwargs): if "case_name" not in kwargs: kwargs["case_name"] = "orchestra_clearwaterims" super(ClearwaterImsVnf, self).__init__(**kwargs) - # self.logger = logging.getLogger("functest.ci.run_tests.orchestra") + self.logger = logging.getLogger("functest.ci.run_tests.orchestra") self.logger.info("kwargs %s", (kwargs)) self.case_dir = pkg_resources.resource_filename( @@ -194,9 +196,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" % @@ -225,15 +225,16 @@ 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, + public=True)) image.create() # self.created_resources.append(image); @@ -465,7 +466,7 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): flavor=self.mano['details']['flavor']['name'], port_settings=[port_settings], security_group_names=[self.mano['details']['sec_group']], - userdata=userdata) + userdata=str(userdata)) orchestra_vm = OpenStackVmInstance(self.snaps_creds, orchestra_settings, image_settings) @@ -493,7 +494,7 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): self.logger.info("Waiting for Open Baton NFVO to be up and running...") timeout = 0 - while timeout < 200: + while timeout < 45: if servertest( self.mano['details']['fip'].ip, "8080"): @@ -501,11 +502,11 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): else: self.logger.info( "Open Baton NFVO is not started yet (%ss)", - (timeout * 5)) - time.sleep(5) + (timeout * 60)) + time.sleep(60) timeout += 1 - if timeout >= 200: + if timeout >= 45: duration = time.time() - start_time self.details["orchestrator"].update( status='FAIL', duration=duration) @@ -598,13 +599,13 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): while self.mano['details']['nsr'].get("status") != 'ACTIVE' \ and self.mano['details']['nsr'].get("status") != 'ERROR': timeout += 1 - self.logger.info("NSR is not yet ACTIVE... (%ss)", 5 * timeout) - if timeout == 300: - self.logger.error("INACTIVE NSR after %s sec..", 5 * timeout) + self.logger.info("NSR is not yet ACTIVE... (%ss)", 60 * timeout) + if timeout == 30: + self.logger.error("INACTIVE NSR after %s sec..", 60 * timeout) duration = time.time() - start_time self.details["vnf"].update(status='FAIL', duration=duration) return False - time.sleep(5) + time.sleep(60) self.mano['details']['nsr'] = json.loads( nsr_agent.find(self.mano['details']['nsr'].get('id'))) @@ -659,8 +660,9 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): try: neutron_client = os_utils.get_neutron_client(self.creds) self.logger.info("Deleting Open Baton Port...") - port = snaps_utils.neutron_utils.get_port_by_name( - neutron_client, '%s_port' % self.case_name) + port = snaps_utils.neutron_utils.get_port( + neutron_client, + port_name='%s_port' % self.case_name) snaps_utils.neutron_utils.delete_port(neutron_client, port) time.sleep(10) except Exception as exc: