refstack: add manually method to let user can set its tempest.conf and defcore.txt 29/33229/2
authorMatthewLi <matthew.lijun@huawei.com>
Tue, 11 Apr 2017 03:15:39 +0000 (23:15 -0400)
committerMatthewLi <matthew.lijun@huawei.com>
Tue, 11 Apr 2017 03:24:53 +0000 (23:24 -0400)
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 <matthew.lijun@huawei.com>
dovetail/compliance/debug.yml
dovetail/conf/functest_config.yml
dovetail/container.py
dovetail/run.py
dovetail/testcase/defcore.tc002.yml [new file with mode: 0644]

index c48d6b6..7a9a231 100644 (file)
@@ -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
index f636c20..5b21555 100644 (file)
@@ -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:
index 4dd3b8f..f7912d5 100644 (file)
@@ -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 +
index aae35e1..98a0008 100755 (executable)
@@ -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 (file)
index 0000000..a8fc3d9
--- /dev/null
@@ -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: