aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2019-01-28 17:24:13 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-01-28 17:24:13 +0000
commit5b851565f1ba2599f05e9f08aac3b8e409b9c3b7 (patch)
treef8b3725657c4cf9a802732be7babd629a0dcfe3c
parentc439221b3ea2880465fb3a26a41be735791c59f9 (diff)
parent900b51c6885339c68cd0762f2b10363c436fbafb (diff)
Merge "Wait for apps being active (juju_epc)"
-rw-r--r--functest/opnfv_tests/vnf/epc/juju_epc.py22
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."""