summaryrefslogtreecommitdiffstats
path: root/testcases
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-06-02 07:41:44 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-02 07:41:44 +0000
commit7a55bacfa9d2c2fff84904578e7ebff0eb4cfb09 (patch)
treeb37a243958b78ec30e04833ed8d57a6790549710 /testcases
parent5bf1647dec6860464eeb082b2875798f0759aa91 (diff)
parent69fe5baee1cfb9f55c798620dda3151eab700bc7 (diff)
Merge "Add criteria in testcases.yaml and Test class"
Diffstat (limited to 'testcases')
-rw-r--r--testcases/OpenStack/vPing/vPing_ssh.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/testcases/OpenStack/vPing/vPing_ssh.py b/testcases/OpenStack/vPing/vPing_ssh.py
index 4f83b874d..11887845c 100644
--- a/testcases/OpenStack/vPing/vPing_ssh.py
+++ b/testcases/OpenStack/vPing/vPing_ssh.py
@@ -176,13 +176,14 @@ def create_security_group(neutron_client):
return sg_id
-def push_results(start_time_ts, duration, test_status):
+def push_results(start_time_ts, duration, status):
try:
logger.debug("Pushing result into DB...")
scenario = functest_utils.get_scenario(logger)
version = functest_utils.get_version(logger)
criteria = "failed"
- if test_status == "OK":
+ test_criteria = functest_utils.get_criteria_by_test("vping_ssh")
+ if eval(test_criteria): # evaluates the regex 'status == "PASS"'
criteria = "passed"
pod_name = functest_utils.get_pod_name(logger)
build_tag = functest_utils.get_build_tag(logger)
@@ -193,7 +194,7 @@ def push_results(start_time_ts, duration, test_status):
criteria, build_tag,
payload={'timestart': start_time_ts,
'duration': duration,
- 'status': test_status})
+ 'status': status})
except:
logger.error("Error pushing results into Database '%s'"
% sys.exc_info()[0])
@@ -438,10 +439,10 @@ def main():
logger.debug("Pinging %s. Waiting for response..." % test_ip)
sec += 1
- test_status = "NOK"
+ test_status = "FAIL"
if EXIT_CODE == 0:
logger.info("vPing OK")
- test_status = "OK"
+ test_status = "PASS"
else:
duration = 0
logger.error("vPing FAILED")