Use timeout to wrap juju-wait 67/56067/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 19 Apr 2018 15:33:47 +0000 (17:33 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Thu, 19 Apr 2018 15:42:28 +0000 (17:42 +0200)
It allows getting logs as releng doesn't push them if global timeout.

Change-Id: I4bbb3818feff37d29b4ccd586f3e940380feef2e
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/opnfv_tests/vnf/epc/juju_epc.py

index a60d4f5..1ba883d 100644 (file)
@@ -82,6 +82,8 @@ class JujuEpc(vnf.VnfOnBoarding):
 
     __logger = logging.getLogger(__name__)
 
+    juju_wait_timeout = '3600'
+
     def __init__(self, **kwargs):
         if "case_name" not in kwargs:
             kwargs["case_name"] = "juju_epc"
@@ -336,7 +338,7 @@ class JujuEpc(vnf.VnfOnBoarding):
         output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
         self.__logger.info("%s\n%s", " ".join(cmd), output)
         self.__logger.info("Waiting for instances .....")
-        cmd = ['juju-wait']
+        cmd = ['timeout', '-t', JujuEpc.juju_wait_timeout, 'juju-wait']
         output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
         self.__logger.info("%s\n%s", " ".join(cmd), output)
         self.__logger.info("Deployed Abot-epc on Openstack")
@@ -382,7 +384,7 @@ class JujuEpc(vnf.VnfOnBoarding):
                'tagnames={}'.format(self.details['test_vnf']['tag_name'])]
         output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
         self.__logger.info("%s\n%s", " ".join(cmd), output)
-        cmd = ['juju-wait']
+        cmd = ['timeout', '-t', JujuEpc.juju_wait_timeout, 'juju-wait']
         output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
         self.__logger.info("%s\n%s", " ".join(cmd), output)
         duration = time.time() - start_time