X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=testcases%2Ffeatures%2Fcopper.py;h=be6744a9505ab36f7d78d1bb346aae4239db5576;hb=dcaef3464dd6923926735a2c2e984c0b036b0797;hp=c312643eb88502ecd01adfa105bbc363a16fb2e9;hpb=982b86f54a93547b6dffe87ccaad15d6ac18b760;p=functest.git diff --git a/testcases/features/copper.py b/testcases/features/copper.py index c312643eb..be6744a95 100755 --- a/testcases/features/copper.py +++ b/testcases/features/copper.py @@ -15,12 +15,12 @@ # limitations under the License. # import argparse -import os import sys import time + import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as functest_utils -import yaml + parser = argparse.ArgumentParser() parser.add_argument("-r", "--report", @@ -28,12 +28,10 @@ parser.add_argument("-r", "--report", action="store_true") args = parser.parse_args() -with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f: - functest_yaml = yaml.safe_load(f) - -dirs = functest_yaml.get('general').get('directories') -FUNCTEST_REPO = dirs.get('dir_repo_functest') -COPPER_REPO = dirs.get('dir_repo_copper') +COPPER_REPO = \ + functest_utils.get_functest_config('general.directories.dir_repo_copper') +RESULTS_DIR = \ + functest_utils.get_functest_config('general.directories.dir_results') logger = ft_logger.Logger("copper").getLogger() @@ -43,7 +41,10 @@ def main(): start_time = time.time() - ret_val = functest_utils.execute_command(cmd, logger, exit_on_error=False) + log_file = RESULTS_DIR + "/copper.log" + ret_val = functest_utils.execute_command(cmd, + exit_on_error=False, + output_file=log_file) stop_time = time.time() duration = round(stop_time - start_time, 1) @@ -59,14 +60,13 @@ def main(): 'duration': duration, 'status': test_status, } - functest_utils.logger_test_results(logger, "Copper", + functest_utils.logger_test_results("Copper", "copper-notification", details['status'], details) try: if args.report: functest_utils.push_results_to_db("copper", "copper-notification", - logger, start_time, stop_time, details['status'],