summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhongbo tian <hongbo.tianhongbo@huawei.com>2017-04-12 08:07:06 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-04-12 08:07:06 +0000
commit52503b8bca1025a3412385b45591999530cedc40 (patch)
treec825a2595aec395715c2af8bb11356ea1e84d1bc
parentac766b065a8032e4aa90dafef2130292364a2483 (diff)
parenta7b6447955d16ef73189d31ed8fb7442f11091be (diff)
Merge "refstack: add manually method to let user can set its tempest.conf and defcore.txt"
-rw-r--r--dovetail/compliance/debug.yml1
-rw-r--r--dovetail/conf/functest_config.yml2
-rw-r--r--dovetail/container.py12
-rwxr-xr-xdovetail/run.py7
-rw-r--r--dovetail/testcase/defcore.tc002.yml18
5 files changed, 38 insertions, 2 deletions
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: