Fix vPing success criteria evaluation bugfix 23/15323/2
authorjose.lausuch <jose.lausuch@ericsson.com>
Thu, 9 Jun 2016 09:26:22 +0000 (11:26 +0200)
committerjose.lausuch <jose.lausuch@ericsson.com>
Thu, 9 Jun 2016 09:30:10 +0000 (11:30 +0200)
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 <jose.lausuch@ericsson.com>
testcases/OpenStack/vPing/vPing_ssh.py

index 2a417eb..3f90bc2 100644 (file)
@@ -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])