From 965e9e6445599461c63fd1500ea0d0d198174347 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Mon, 14 Nov 2016 11:54:06 +0100 Subject: Bug fix odl-sfc I was not taking into account the case where the returned list is empty Change-Id: I533ea8fbc286cb564dccec06750cd1a8bbcf52f9 Signed-off-by: Manuel Buil --- functest/opnfv_tests/features/sfc/sfc.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'functest/opnfv_tests/features') diff --git a/functest/opnfv_tests/features/sfc/sfc.py b/functest/opnfv_tests/features/sfc/sfc.py index 42fac561..e048d90f 100755 --- a/functest/opnfv_tests/features/sfc/sfc.py +++ b/functest/opnfv_tests/features/sfc/sfc.py @@ -414,15 +414,20 @@ def capture_time_log(compute_clients): while True: rsps = ovs_logger.ofctl_time_counter(compute_clients[0]) if not i: - first_RSP = rsps[0] - i = i + 1 - if(first_RSP != rsps[0] and len(rsps) > 1): - if (rsps[0] == rsps[1]): - stop_time = time.time() - logger.info("classification rules updated") - difference = stop_time - start_time - logger.info("It took %s seconds" % difference) - break + if len(rsps) > 0: + first_RSP = rsps[0] + i = i + 1 + else: + first_RSP = 0 + i = i + 1 + if (len(rsps) > 1): + if(first_RSP != rsps[0]): + if (rsps[0] == rsps[1]): + stop_time = time.time() + logger.info("classification rules updated") + difference = stop_time - start_time + logger.info("It took %s seconds" % difference) + break time.sleep(1) return -- cgit 1.2.3-korg