aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/OpenStack
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-05-31 11:39:51 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-06-01 12:20:53 +0200
commit69fe5baee1cfb9f55c798620dda3151eab700bc7 (patch)
treec251f280704cfb390212a466662ce0c1615c2005 /testcases/OpenStack
parent063eac6f79662606d11a68617e0cb2aaa1c449b6 (diff)
Add criteria in testcases.yaml and Test class
JIRA: FUNCTEST-257 Added example of usage in vping_ssh Change-Id: Iac143b811db163f0f86682b0688948c20843ede5 Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'testcases/OpenStack')
-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")