From 5a1ec01f3d560ea68cbe811a98529920af7ee684 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Wed, 20 Sep 2017 18:04:27 +0200 Subject: 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 --- sfc/lib/utils.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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:") -- cgit 1.2.3-korg