From a7b6447955d16ef73189d31ed8fb7442f11091be Mon Sep 17 00:00:00 2001 From: MatthewLi Date: Mon, 10 Apr 2017 23:15:39 -0400 Subject: refstack: add manually method to let user can set its tempest.conf and defcore.txt JIRA: DOVETAIL-394 for refstack, userguide is listed in https://gerrit.opnfv.org/gerrit/#/c/33049/ in CI, use the automate way to generate tempest.conf to let refstack run against SUT, i.e., defcore.tc001.yml will provide a way to let user can let refstack run against SUT manually, i.e. defcore.tc002.yml since the tempest.conf autometely generated may not satisfied with SUT, users can adjust its tempest.conf to let the defcore testcases pass. Change-Id: I5ed212c9c6d864d352d1c497ea039cc553461158 Signed-off-by: MatthewLi --- dovetail/compliance/debug.yml | 1 + dovetail/conf/functest_config.yml | 2 ++ dovetail/container.py | 12 ++++++++++-- dovetail/run.py | 7 +++++++ dovetail/testcase/defcore.tc002.yml | 18 ++++++++++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 dovetail/testcase/defcore.tc002.yml (limited to 'dovetail') diff --git a/dovetail/compliance/debug.yml b/dovetail/compliance/debug.yml index c48d6b65..7a9a231a 100644 --- a/dovetail/compliance/debug.yml +++ b/dovetail/compliance/debug.yml @@ -7,6 +7,7 @@ debug: testcases_list: - dovetail.example.tc002 - dovetail.defcore.tc001 +# - dovetail.defcore.tc002 # - dovetail.ipv6.tc008 # - dovetail.ipv6.tc009 # - dovetail.ipv6.tc018 diff --git a/dovetail/conf/functest_config.yml b/dovetail/conf/functest_config.yml index f636c204..5b215550 100644 --- a/dovetail/conf/functest_config.yml +++ b/dovetail/conf/functest_config.yml @@ -3,6 +3,8 @@ functest: image_name: opnfv/functest docker_tag: latest opts: '-id --privileged=true' + config: + dir: '/home/opnfv/userconfig' pre_condition: - 'echo test for precondition in functest' cmds: diff --git a/dovetail/container.py b/dovetail/container.py index 4dd3b8f3..f7912d58 100644 --- a/dovetail/container.py +++ b/dovetail/container.py @@ -123,10 +123,18 @@ class Container(object): if not config: return None + # for refstack, support user self_defined configuration + config_volume = "" + if type.lower() == "functest": + config_volume = \ + ' -v %s:%s ' % (dovetail_config['userconfig_dir'], + dovetail_config["functest"]['config']['dir']) + result_volume = ' -v %s:%s ' % (dovetail_config['result_dir'], dovetail_config[type]['result']['dir']) - cmd = 'sudo docker run %s %s %s %s %s %s %s /bin/bash' % \ - (opts, envs, config, sshkey, openrc, result_volume, docker_image) + cmd = 'sudo docker run %s %s %s %s %s %s %s %s /bin/bash' % \ + (opts, envs, config, sshkey, openrc, config_volume, + result_volume, docker_image) dt_utils.exec_cmd(cmd, cls.logger) ret, container_id = \ dt_utils.exec_cmd("sudo docker ps | grep " + docker_image + diff --git a/dovetail/run.py b/dovetail/run.py index aae35e12..98a00085 100755 --- a/dovetail/run.py +++ b/dovetail/run.py @@ -172,11 +172,18 @@ def get_result_path(): dt_cfg.dovetail_config['result_dir'] = result_path +def get_userconfig_path(): + dovetail_home = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + userconfig_path = os.path.join(dovetail_home, 'userconfig') + dt_cfg.dovetail_config['userconfig_dir'] = userconfig_path + + def main(*args, **kwargs): """Dovetail compliance test entry!""" build_tag = "daily-master-%s" % str(uuid.uuid4()) dt_cfg.dovetail_config['build_tag'] = build_tag get_result_path() + get_userconfig_path() clean_results_dir() if kwargs['debug']: os.environ['DEBUG'] = 'true' diff --git a/dovetail/testcase/defcore.tc002.yml b/dovetail/testcase/defcore.tc002.yml new file mode 100644 index 00000000..a8fc3d95 --- /dev/null +++ b/dovetail/testcase/defcore.tc002.yml @@ -0,0 +1,18 @@ +--- +dovetail.defcore.tc002: + name: dovetail.defcore.tc002 + objective: > # Set of DefCore tempest test cases not flagged and required. It only contains OpenStack core (no object storage) + # The approved guidelines (2016.08) are valid for Kilo, Liberty, Mitaka and Newton releases of OpenStack + # The list can be generated using the Rest API from RefStack project: + # https://refstack.openstack.org/api/v1/guidelines/2016.08/tests?target=compute&type=required&alias=true&flag=false + validate: + type: functest + testcase: refstack_defcore + pre_condition: + - 'echo test for precondition in testcase' + cmds: + - 'cd /home/opnfv/repos/refstack-client; source .venv/bin/activate; ./refstack-client test -c /home/opnfv/userconfig/tempest.conf -v --test-list /home/opnfv/userconfig/defcore.txt' + post_condition: + - 'echo test for postcondition in testcase' + report: + sub_testcase_list: -- cgit 1.2.3-korg