bugfix: correct the path of test_plan 13/24313/1
authorwu.zhihui <wu.zhihui1@zte.com.cn>
Mon, 14 Nov 2016 08:58:38 +0000 (16:58 +0800)
committerwu.zhihui <wu.zhihui1@zte.com.cn>
Mon, 14 Nov 2016 08:58:38 +0000 (16:58 +0800)
JIRA: QTIP-161

Change-Id: If591c6b6d6ca1d4d7b721115c93c7b58ff7d819b
Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
qtip/utils/args_handler.py
qtip/utils/cli.py
tests/args_handler_test.py
tests/cli_test.py

index 879fd20..513309a 100644 (file)
@@ -21,13 +21,13 @@ def get_files_in_suite(suite_name, case_type='all'):
 
 
 def get_files_in_test_plan(lab, suite_name, case_type='all'):
-    test_case_all = os.listdir('./test_plan/{0}/{1}'.format(lab, suite_name))
+    test_case_all = os.listdir('benchmarks/test_plan/{0}/{1}'.format(lab, suite_name))
     return test_case_all if case_type == 'all' else \
         filter(lambda x: case_type in x, test_case_all)
 
 
 def get_benchmark_path(lab, suit, benchmark):
-    return './test_plan/{0}/{1}/{2}'.format(lab, suit, benchmark)
+    return 'benchmarks/test_plan/{0}/{1}/{2}'.format(lab, suit, benchmark)
 
 
 def check_suite(suite_name):
@@ -35,11 +35,11 @@ def check_suite(suite_name):
 
 
 def check_lab_name(lab_name):
-    return True if os.path.isdir('test_plan/' + lab_name) else False
+    return True if os.path.isdir('benchmarks/test_plan/' + lab_name) else False
 
 
 def check_benchmark_name(lab, file, benchmark):
-    return os.path.isfile('test_plan/' + lab + '/' + file + '/' + benchmark)
+    return os.path.isfile('benchmarks/test_plan/' + lab + '/' + file + '/' + benchmark)
 
 
 def _get_f_name(test_case_path):
index def7006..c0a1421 100644 (file)
@@ -23,7 +23,7 @@ class Cli:
         parser = argparse.ArgumentParser()
         parser.add_argument('-l ', '--lab', required=True, help='Name of Lab '
                             'on which being tested, These can'
-                            'be found in the test_plan/ directory. Please '
+                            'be found in the benchmarks/test_plan/ directory. Please '
                             'ensure that you have edited the respective files '
                             'before using them. For testing other than through Jenkins'
                             ' The user should list default after -l . all the fields in'
@@ -49,7 +49,7 @@ class Cli:
             sys.exit(1)
 
         if not args_handler.check_lab_name(args.lab):
-            logger.error("You have specified a lab that is not present under test_plan/.\
+            logger.error("You have specified a lab that is not present under benchmarks/test_plan/.\
                 Please enter correct file. If unsure how to proceed, use -l default.")
             sys.exit(1)
         suite = args.file
index 625a42f..76c0646 100644 (file)
@@ -13,7 +13,7 @@ import utils.args_handler
 
 class TestClass:
     @pytest.mark.parametrize("test_input, expected", [
-        (['fuel', '/home', './test_plan/default/network/iperf_bm.yaml'],
+        (['fuel', '/home', 'benchmarks/test_plan/default/network/iperf_bm.yaml'],
          ['fuel', '/home', "iperf",
           [('1-server', ['10.20.0.23']), ('2-host', ['10.20.0.24'])],
           "iperf_bm.yaml",
index 255c2a3..cc8c763 100644 (file)
@@ -30,8 +30,8 @@ class TestClass:
         (['-l',
           'default',
           '-f',
-          'storage'], [('fuel', '/home', './test_plan/default/storage/fio_bm.yaml'),
-                       ('fuel', '/home', './test_plan/default/storage/fio_vm.yaml')])
+          'storage'], [('fuel', '/home', 'benchmarks/test_plan/default/storage/fio_bm.yaml'),
+                       ('fuel', '/home', 'benchmarks/test_plan/default/storage/fio_vm.yaml')])
     ])
     @mock.patch('func.cli.args_handler.prepare_and_run_benchmark')
     def test_cli_successful(self, mock_args_handler, test_input, expected):