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-22 17:06:35 +0000
commit5a1ec01f3d560ea68cbe811a98529920af7ee684 (patch)
tree5cae3b404135a722649a3423cda4c9f54eb6569e
parent2ce3eccae3de3f97c2ad8b2041d1b068d070a6e3 (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:")