increase timeout of NFVO installation
[functest.git] / functest / opnfv_tests / vnf / ims / orchestra_clearwaterims.py
index 216632e..6a11160 100644 (file)
@@ -31,7 +31,6 @@ from snaps.openstack.create_network import (
     SubnetSettings,
     PortSettings)
 from snaps.openstack.create_router import OpenStackRouter, RouterSettings
-from snaps.openstack.os_credentials import OSCreds
 from snaps.openstack.create_instance import (
     VmInstanceSettings,
     OpenStackVmInstance)
@@ -131,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"
@@ -142,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(
@@ -208,15 +209,13 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding):
         super(ClearwaterImsVnf, self).prepare()
 
         self.logger.info("Additional pre-configuration steps")
-        self.logger.info("creds %s", (self.creds))
-
-        self.snaps_creds = OSCreds(
-            username=self.creds['username'],
-            password=self.creds['password'],
-            auth_url=self.creds['auth_url'],
-            project_name=self.creds['tenant'],
-            identity_api_version=int(os_utils.get_keystone_client_version()))
 
+        self.creds = {
+                "tenant": self.tenant_name,
+                "username": self.tenant_name,
+                "password": self.tenant_name,
+                "auth_url": os_utils.get_credentials()['auth_url']
+                }
         self.prepare_images()
         self.prepare_flavor()
         self.prepare_security_groups()
@@ -495,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"):
@@ -503,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)
@@ -600,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')))