summaryrefslogtreecommitdiffstats
path: root/testcases/features/bgpvpn.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-06-08 15:56:54 +0200
committerMorgan Richomme <morgan.richomme@orange.com>2016-06-08 16:43:47 +0200
commit03fc68820d1badd600832de3b7c6dd72368dd198 (patch)
tree0ece513a5ea3acd1296e299fd1e09a331f80ad03 /testcases/features/bgpvpn.py
parent4c971bff1c2e4665bbf389f84acfa4d2c81f9b55 (diff)
Adapt functest testcase to APi refactoring
JIRA: FUNCTEST-303 Change-Id: Ia276d9ca6e8d62b496c3b5f81561b14b02c43fd7 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'testcases/features/bgpvpn.py')
-rw-r--r--testcases/features/bgpvpn.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/testcases/features/bgpvpn.py b/testcases/features/bgpvpn.py
index e3db9209d..bac255913 100644
--- a/testcases/features/bgpvpn.py
+++ b/testcases/features/bgpvpn.py
@@ -12,6 +12,7 @@
import argparse
import os
import re
+import time
import yaml
import ConfigParser
@@ -41,6 +42,7 @@ logger = ft_logger.Logger("bgpvpn").getLogger()
def main():
logger.info("Running BGPVPN Tempest test case...")
+ start_time = time.time()
cmd = 'cd ' + BGPVPN_REPO + ';pip install --no-deps -e .'
ft_utils.execute_command(cmd, logger, exit_on_error=False)
@@ -93,8 +95,9 @@ def main():
"errors": error_logs}
logger.info("Results: " + str(json_results))
- criteria = "failed"
+ criteria = "FAIL"
# criteria = success rate = 100% (i.e all tests passed)
+ # TODO use criteria defined in config file
criteria_run = int(tests)
if not failed:
criteria_failed = 0
@@ -102,20 +105,19 @@ def main():
criteria_failed = int(failed)
if criteria_run > 0 and criteria_failed < 1:
- criteria = "passed"
+ criteria = "PASS"
# Push results in payload of testcase
if args.report:
- logger.debug("Push result into DB")
- url = TEST_DB_URL
- scenario = ft_utils.get_scenario(logger)
- version = ft_utils.get_version(logger)
- pod_name = ft_utils.get_pod_name(logger)
- build_tag = ft_utils.get_build_tag(logger)
-
- ft_utils.push_results_to_db(url, "sdnvpn", "bgpvpn_api", logger,
- pod_name, version, scenario, criteria,
- build_tag, json_results)
+ logger.debug("Push bgpvpn results into DB")
+ stop_time = time.time()
+ ft_utils.push_results_to_db("sdnvpn",
+ "bgpvpn_api",
+ logger,
+ start_time,
+ stop_time,
+ criteria,
+ json_results)
if __name__ == '__main__':
main()