Use timeout to wrap juju-wait 71/56071/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Thu, 19 Apr 2018 15:33:47 +0000 (17:33 +0200)
committerCedric Ollivier <cedric.ollivier@orange.com>
Thu, 19 Apr 2018 19:02:19 +0000 (19:02 +0000)
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>
(cherry picked from commit 251024b29199ecee86661b8850751d982b7c5797)

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