diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-01-28 16:56:57 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-01-28 19:11:20 +0100 |
commit | 988997ab1ba3a8f112e857ee984a57917ce8c3d8 (patch) | |
tree | 6b2dbe723b2a1feb72482349ab3b74ce870a77e1 | |
parent | d06809129d3c8c86fd9df79b96620eaf54b0b221 (diff) |
Wait for apps being active (juju_epc)
It seems that juju-wait doesn't wait for all apps.
Juju_epc passes in functest-virtual thanks to that additional tries.
Change-Id: I161902c6308cfa6323c21e09140d16e036768ece
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit 900b51c6885339c68cd0762f2b10363c436fbafb)
-rw-r--r-- | functest/opnfv_tests/vnf/epc/juju_epc.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/functest/opnfv_tests/vnf/epc/juju_epc.py b/functest/opnfv_tests/vnf/epc/juju_epc.py index ea09084df..3830907a6 100644 --- a/functest/opnfv_tests/vnf/epc/juju_epc.py +++ b/functest/opnfv_tests/vnf/epc/juju_epc.py @@ -264,14 +264,20 @@ class JujuEpc(singlevm.VmReady2): def check_app(self, name='abot-epc-basic', status='active'): """Check application status.""" cmd = ['juju', 'status', '--format', 'short', name] - output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) - self.__logger.info("%s\n%s", " ".join(cmd), output) - ret = re.search(r'(?=workload:({})\))'.format(status), output) - if ret: - self.__logger.info("%s workload is %s", name, status) - return True - self.__logger.error("%s workload differs from %s", name, status) - return False + for i in range(10): + output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) + self.__logger.info("%s\n%s", " ".join(cmd), output) + ret = re.search(r'(?=workload:({})\))'.format(status), output) + if ret: + self.__logger.info("%s workload is %s", name, status) + break + self.__logger.info( + "loop %d: %s workload differs from %s", i + 1, name, status) + time.sleep(60) + else: + self.__logger.error("%s workload differs from %s", name, status) + return False + return True def deploy_vnf(self): """Deploy ABOT-OAI-EPC.""" |