diff options
author | zhifeng.jiang <jiang.zhifeng@zte.com.cn> | 2016-09-09 23:46:07 +0800 |
---|---|---|
committer | zhifeng.jiang <jiang.zhifeng@zte.com.cn> | 2016-09-20 20:16:00 +0800 |
commit | 64db4bb925f771b053f922fe324a624c5da75ad9 (patch) | |
tree | d12977196a087f7a355f9349fe6872a08bc4d77a /func/args_handler.py | |
parent | 471817a86ae20cb288347fbedcb865ac7e31e60f (diff) |
Run benchmark test in restful server post api
modification:
Call ansible async in restful server post api
Set the job state 'finished' when finish benchmark test
Terminate the next benchmark in restful server delete api
job result will be in next commit
JIRA:QTIP-97
Change-Id: I252482dddd9b35ba33f992e8ea19037d8919fad6
Signed-off-by: zhifeng.jiang <jiang.zhifeng@zte.com.cn>
Diffstat (limited to 'func/args_handler.py')
-rw-r--r-- | func/args_handler.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/func/args_handler.py b/func/args_handler.py index 57ecfcbd..90d902b6 100644 --- a/func/args_handler.py +++ b/func/args_handler.py @@ -7,19 +7,23 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## import os +from operator import add +import simplejson as json from func.env_setup import Env_setup from func.spawn_vm import SpawnVM from func.driver import Driver -def get_files_in_test_list(suit_name): - with open('test_list/' + suit_name, 'r') as fin_put: - benchmark_list = fin_put.readlines() - return map(lambda x: x.rstrip(), benchmark_list) +def get_files_in_test_list(suit_name, case_type='all'): + benchmark_list = json.load(file('test_list/{0}'.format(suit_name))) + return reduce(add, benchmark_list.values()) \ + if case_type == 'all' else benchmark_list[case_type] -def get_files_in_test_case(lab, suit_name): - return os.listdir('./test_cases/{0}/{1}'.format(lab, suit_name)) +def get_files_in_test_case(lab, suit_name, case_type='all'): + test_case_all = os.listdir('./test_cases/{0}/{1}'.format(lab, suit_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): |