Merge "bug-fix: coverage package missing for ci verify"
authorYu Yang (Gabriel) <Gabriel.yuyang@huawei.com>
Wed, 10 Jan 2018 01:51:42 +0000 (01:51 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Wed, 10 Jan 2018 01:51:42 +0000 (01:51 +0000)
test/__init__.py [new file with mode: 0644]
utils/env_prepare/stack_prepare.py
utils/infra_setup/runner/docker_env.py
verify.sh

diff --git a/test/__init__.py b/test/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
index 25c2a29..c7dae39 100644 (file)
@@ -37,6 +37,16 @@ def _prepare_env_daemon(test_yardstick):
                             config.bottlenecks_config["yardstick_rc_dir"])
         docker_env.docker_exec_cmd(yardstick_contain,
                                    cmd)
+        file_orig = ("/home/opnfv/repos/yardstick/etc"
+                     "/yardstick/yardstick.conf.sample")
+        file_after = "/etc/yardstick/yardstick.conf"
+        cmd = "cp %s %s" % (file_orig,
+                            file_after)
+        docker_env.docker_exec_cmd(yardstick_contain,
+                                   cmd)
+        cmd = "sed -i '12s/http/file/g' /etc/yardstick/yardstick.conf"
+        docker_env.docker_exec_cmd(yardstick_contain,
+                                   cmd)
 
     # update the external_network
     _source_file(rc_file)
index 438d3d1..54478ff 100644 (file)
@@ -45,7 +45,7 @@ def env_yardstick(docker_name):
     volume = get_self_volume()
     yardstick_tag = os.getenv("Yardstick_TAG")
     if yardstick_tag is None:
-        yardstick_tag = "latest"
+        yardstick_tag = "danube.3.1"
     env_docker = client.containers.run(image="opnfv/yardstick:%s"
                                              % yardstick_tag,
                                        privileged=True,
index 1e0d013..f8668e6 100755 (executable)
--- a/verify.sh
+++ b/verify.sh
@@ -14,7 +14,7 @@
 getopts ":f" FILE_OPTION
 
 run_flake8() {
-    echo "Running flake8 ... "
+    echo "Running flake8 for python style check... "
     logfile=flake8_verify.log
     if [ $FILE_OPTION == "f" ]; then
        flake8 --append-config=flake8_cfg testsuites/posca/ utils/ > $logfile
@@ -33,16 +33,13 @@ run_flake8() {
     fi
 }
 
-run_tests() {
-    echo "Running unittest ... "
-    #will add future
+run_nosetests() {
+    echo "Running unit and coverage test ... "
+    nosetests --with-coverage --cover-tests \
+        --cover-min-percentage 100 \
+        test/
 }
 
-run_coverage() {
-    echo "Running coverage ..."
-    #will add future
-}
 
 run_flake8
-run_tests
-run_coverage
+run_nosetests