aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2017-09-20 18:04:27 +0200
committerManuel Buil <mbuil@suse.com>2017-09-20 18:04:27 +0200
commit2de96bf8d3f2ed5240685c58501924f53bb58e6e (patch)
tree5cae3b404135a722649a3423cda4c9f54eb6569e
parent9c11d59035ff1741c5e6d935aa7c2ed23d15f485 (diff)
Bug fix: Add iteration to check RSP config in ODL
JIRA: SFC-110 Sometimes the test is quicker than ODL and when it checks the configured RSP, that configuration has not yet been submitted in ODL, thus ODL replies with an empty list. We add an iteration to try again for a couple of times Change-Id: I21e4ac3fc3a919791daa7e41cb2953f7565c4ebb Signed-off-by: Manuel Buil <mbuil@suse.com>
-rw-r--r--sfc/lib/utils.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py
index 9d44b3eb..e406568f 100644
--- a/sfc/lib/utils.py
+++ b/sfc/lib/utils.py
@@ -500,7 +500,14 @@ def wait_for_classification_rules(ovs_logger, compute_nodes, odl_ip, odl_port,
raise Exception("No compute where the client is was found")
# Find the configured rsps in ODL. Its format is nsp_destPort
- promised_rsps = promised_rsps_in_computes(odl_ip, odl_port)
+ promised_rsps = []
+ timeout2 = 10
+ while not promised_rsps:
+ promised_rsps = promised_rsps_in_computes(odl_ip, odl_port)
+ timeout2 -= 1
+ if timeout2 == 0:
+ raise Exception("RSPs not configured in ODL")
+ time.sleep(3)
while timeout > 0:
logger.info("RSPs in ODL Operational DataStore:")