Remove old tacker setup
[functest.git] / testcases / features / copper.py
index c312643..be6744a 100755 (executable)
 # 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'],