diff options
author | Leo Wang <grakiss.wanglei@huawei.com> | 2016-09-22 21:56:54 -0400 |
---|---|---|
committer | Leo Wang <grakiss.wanglei@huawei.com> | 2016-09-30 05:30:22 -0400 |
commit | 39942dc9c5bc152a6ed20534755cc0dc38d85ede (patch) | |
tree | 8d4a980e7454b26cd97216a8e91de6c947692e9a /scripts/conf | |
parent | c554b6951f8ee8298d3f8ae8f53ba468dbf4c164 (diff) |
Use template to unify commands in functest/yardstick
JIRA: DOVETAIL-19
1. use jinja2 to unify commands in config files
2. it simplify the process of test execution, put the dissimilarity in config
3. add precondition/postcondition for functest/yardstick config
Change-Id: Ib996b11ea065b61910b34b78191bb7b1ffd92e59
Signed-off-by: Leo Wang <grakiss.wanglei@huawei.com>
Diffstat (limited to 'scripts/conf')
-rw-r--r-- | scripts/conf/dovetail_config.py | 2 | ||||
-rw-r--r-- | scripts/conf/dovetail_config.yml | 12 | ||||
-rw-r--r-- | scripts/conf/functest_config.yml | 11 | ||||
-rw-r--r-- | scripts/conf/yardstick_config.yml | 9 |
4 files changed, 31 insertions, 3 deletions
diff --git a/scripts/conf/dovetail_config.py b/scripts/conf/dovetail_config.py index 92d1f479..e7942f52 100644 --- a/scripts/conf/dovetail_config.py +++ b/scripts/conf/dovetail_config.py @@ -17,7 +17,7 @@ import os with open(os.path.join(os.getcwd(),'conf','dovetail_config.yml')) as f: dovetail_config = yaml.safe_load(f) -for extra_config_file in dovetail_config['extra_config']: +for extra_config_file in dovetail_config['include_config']: with open(os.path.join(os.getcwd(),'conf',extra_config_file)) as f: extra_config = yaml.safe_load(f) dovetail_config.update(extra_config) diff --git a/scripts/conf/dovetail_config.yml b/scripts/conf/dovetail_config.yml index 57d6e894..901988f8 100644 --- a/scripts/conf/dovetail_config.yml +++ b/scripts/conf/dovetail_config.yml @@ -3,7 +3,17 @@ work_dir: /home/opnfv/dovetail result_dir: /home/opnfv/dovetail/results report_file: 'dovetail_report.txt' -extra_config: +# used for testcase cmd template in jinja2 format +# we have two variables available now +# parameter path, use this path to walk through python object and get value +# and the python object is "testcase" object by hard-coded +parameters: + - name: testcase + path: '("name",)' + - name: script_testcase + path: '("scripts", "testcase")' + +include_config: - functest_config.yml - yardstick_config.yml diff --git a/scripts/conf/functest_config.yml b/scripts/conf/functest_config.yml index 86e6ce75..cd33dc59 100644 --- a/scripts/conf/functest_config.yml +++ b/scripts/conf/functest_config.yml @@ -6,10 +6,19 @@ functest: -e BUILD_TAG=dovetail -e CI_DEBUG=true -e DEPLOY_TYPE=baremetal' opts: '-id --privileged=true' result_dir: '/home/opnfv/functest/results' + pre_condition: + cmds: + - 'echo test for precondition' testcase: pre_cmd: 'python /home/opnfv/repos/functest/ci/prepare_env.py start' - exec_cmd: 'python /home/opnfv/repos/functest/ci/run_tests.py -t %s -r' + exec_cmd: 'python /home/opnfv/repos/functest/ci/run_tests.py -t {{script_testcase}} -r' post_cmd: '' + cmds: + - 'python /home/opnfv/repos/functest/ci/prepare_env.py start' + - 'python /home/opnfv/repos/functest/ci/run_tests.py -t {{script_testcase}} -r' + post_condition: + cmds: + - '' result: dir: '/home/opnfv/functest/results' store_type: 'file' diff --git a/scripts/conf/yardstick_config.yml b/scripts/conf/yardstick_config.yml index 9eda6e54..7a40dc70 100644 --- a/scripts/conf/yardstick_config.yml +++ b/scripts/conf/yardstick_config.yml @@ -9,9 +9,18 @@ yardstick: result_dir: '/tmp/yardstick/result' shell_dir: '/tmp/yardstick' shell_dir_name: 'prepare_test_yard' + pre_condition: + cmds: + - 'echo test for precondition' testcase: build_test_cmd: '/tmp/yardstick/build_run_test.sh %s.yaml /tmp/yardstick/result/%s.out' test_cmd: '/tmp/yardstick/run_test.sh %s.yaml /tmp/yardstick/result/%s.out' + cmds: + - '/tmp/yardstick/build_run_test.sh {{script_testcase}}.yaml /tmp/yardstick/result/{{testcase}}.out' + - '/tmp/yardstick/run_test.sh {{script_testcase}}.yaml /tmp/yardstick/result/{{testcase}}.out' + post_condition: + cmds: + - '' result: dir: '/tmp/yardstick/result' store_type: 'file' |