From b049ac7ad61134b4a405505db5e041fd6bdb8a5c Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Thu, 9 Jun 2016 11:26:22 +0200 Subject: Fix vPing success criteria evaluation bugfix Switching back to the odl approach. Need more discussions to see how to evaluate the result from testcases.yaml Change-Id: Iaa866db3010d35bd2cc427190dfe64db6b732a93 Signed-off-by: jose.lausuch --- testcases/OpenStack/vPing/vPing_ssh.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'testcases/OpenStack') diff --git a/testcases/OpenStack/vPing/vPing_ssh.py b/testcases/OpenStack/vPing/vPing_ssh.py index 2a417eb3c..3f90bc214 100644 --- a/testcases/OpenStack/vPing/vPing_ssh.py +++ b/testcases/OpenStack/vPing/vPing_ssh.py @@ -391,6 +391,7 @@ def main(): cmd = '~/ping.sh ' + test_ip flag = False + status = "FAIL" while True: time.sleep(1) @@ -400,7 +401,7 @@ def main(): for line in output: if "vPing OK" in line: logger.info("vPing detected!") - + status = "PASS" # we consider start time at VM1 booting stop_time = time.time() duration = round(stop_time - start_time, 1) @@ -418,12 +419,8 @@ def main(): logger.debug("Pinging %s. Waiting for response..." % test_ip) sec += 1 - test_status = "FAIL" - test_criteria = functest_utils.get_criteria_by_test("vping_ssh") - - if eval(test_criteria): + if status == "PASS": logger.info("vPing OK") - test_status = "PASS" else: duration = 0 logger.error("vPing FAILED") @@ -436,10 +433,10 @@ def main(): logger, start_time, stop_time, - test_status, + status, details={'timestart': start_time, 'duration': duration, - 'status': test_status}) + 'status': status}) except: logger.error("Error pushing results into Database '%s'" % sys.exc_info()[0]) -- cgit 1.2.3-korg