summaryrefslogtreecommitdiffstats
path: root/func
diff options
context:
space:
mode:
authorwu.zhihui <wu.zhihui1@zte.com.cn>2016-10-22 14:37:58 +0800
committerwu.zhihui <wu.zhihui1@zte.com.cn>2016-10-22 14:43:55 +0800
commitc40c2db74a1d59496a8c999cfc9c0a2431fda767 (patch)
treecf8cb0b28de61c2fe3f4795bcc7b350ddaf97825 /func
parent492c8a551b6d5b745c54c2fa086eee1e02e97c62 (diff)
Remove directory test_list
Directory benchmarks/suite will be used instead of test_list. JIRA: QTIP-131 Change-Id: I2c1f534b72361cb2e6469463ef5e43714d6dc993 Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'func')
-rw-r--r--func/args_handler.py8
-rw-r--r--func/cli.py28
2 files changed, 20 insertions, 16 deletions
diff --git a/func/args_handler.py b/func/args_handler.py
index 59712800..2f7c8957 100644
--- a/func/args_handler.py
+++ b/func/args_handler.py
@@ -14,8 +14,8 @@ from func.spawn_vm import SpawnVM
from func.driver import Driver
-def get_files_in_test_list(suite_name, case_type='all'):
- benchmark_list = json.load(file('test_list/{0}'.format(suite_name)))
+def get_files_in_suite(suite_name, case_type='all'):
+ benchmark_list = json.load(file('benchmarks/suite/{0}'.format(suite_name)))
return reduce(add, benchmark_list.values()) \
if case_type == 'all' else benchmark_list[case_type]
@@ -30,8 +30,8 @@ def get_benchmark_path(lab, suit, benchmark):
return './test_cases/{0}/{1}/{2}'.format(lab, suit, benchmark)
-def check_suite_in_test_list(suite_name):
- return True if os.path.isfile('test_list/' + suite_name) else False
+def check_suite(suite_name):
+ return True if os.path.isfile('benchmarks/suite/' + suite_name) else False
def check_lab_name(lab_name):
diff --git a/func/cli.py b/func/cli.py
index d914a2de..c5f5d2b7 100644
--- a/func/cli.py
+++ b/func/cli.py
@@ -11,6 +11,9 @@ import sys
import os
import args_handler
import argparse
+from utils import logger_utils
+
+logger = logger_utils.QtipLogger('cli').get
class Cli:
@@ -26,40 +29,41 @@ class Cli:
' The user should list default after -l . all the fields in'
' the files are necessary and should be filled')
parser.add_argument('-f', '--file', required=True, help='File in '
- 'test_list with the list of tests. there are three files'
+ 'benchmarks/suite/ with the list of tests. there are three files'
'\n compute '
'\n storage '
'\n network '
'They contain all the tests that will be run. They are listed by suite.'
'Please ensure there are no empty lines')
parser.add_argument('-b', '--benchmark', help='Name of the benchmark.'
- 'Can be found in test_lists/file_name')
+ 'Can be found in benchmarks/suite/file_name')
return parser.parse_args(args)
def __init__(self, args=sys.argv[1:]):
args = self._parse_args(args)
- if not args_handler.check_suite_in_test_list(args.file):
- print('\n\n ERROR: Test File Does not exist in test_list/ please enter correct file \n\n')
+ if not args_handler.check_suite(args.file):
+ logger.error("ERROR: This suite file doesn't exist under benchmarks/suite/.\
+ Please enter correct file." % str(args.file))
sys.exit(1)
if not args_handler.check_lab_name(args.lab):
- print('\n\n You have specified a lab that is not present in test_cases/ please enter \
- correct file. If unsure how to proceed, use -l default.\n\n')
+ logger.error("You have specified a lab that is not present under test_cases/.\
+ Please enter correct file. If unsure how to proceed, use -l default.")
sys.exit(1)
suite = args.file
- benchmarks = args_handler.get_files_in_test_list(suite)
+ benchmarks = args_handler.get_files_in_suite(suite)
test_cases = args_handler.get_files_in_test_case(args.lab, suite)
benchmarks_list = filter(lambda x: x in test_cases, benchmarks)
if args.benchmark:
if not args_handler.check_benchmark_name(args.lab, args.file, args.benchmark):
- print('\n\n You have specified an incorrect benchmark. Please'
- 'enter the correct one.\n\n')
+ logger.error("You have specified an incorrect benchmark.\
+ Please enter the correct one.")
sys.exit(1)
else:
- print("Starting with " + args.benchmark)
+ logger.info("Starting with " + args.benchmark)
args_handler.prepare_and_run_benchmark(
os.environ['INSTALLER_TYPE'], os.environ['PWD'],
args_handler.get_benchmark_path(args.lab.lower(), args.file, args.benchmark))
@@ -68,5 +72,5 @@ class Cli:
os.environ['INSTALLER_TYPE'], os.environ['PWD'],
args_handler.get_benchmark_path(args.lab.lower(), suite, x)), benchmarks_list)
- print('{0} is not a Template in the Directory Enter a Valid file name.'
- 'or use qtip.py -h for list'.format(filter(lambda x: x not in test_cases, benchmarks)))
+ logger.info("{0} is not a Template in the Directory Enter a Valid file name.\
+ or use qtip.py -h for list".format(filter(lambda x: x not in test_cases, benchmarks)))