Merge "[Functest] Adapt set-functest-env to download OS images"
authorJose Lausuch <jose.lausuch@ericsson.com>
Mon, 17 Jul 2017 07:38:55 +0000 (07:38 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 17 Jul 2017 07:38:55 +0000 (07:38 +0000)
15 files changed:
jjb/ci_gate_security/anteater-security-audit-weekly.sh
jjb/fuel/fuel-daily-jobs.yml
jjb/functest/set-functest-env.sh
jjb/releng/automate.yml
utils/fetch_os_creds.sh
utils/test/testapi/htmlize/htmlize.py
utils/test/testapi/opnfv_testapi/tests/unit/resources/test_pod.py
utils/test/testapi/opnfv_testapi/tests/unit/resources/test_project.py
utils/test/testapi/opnfv_testapi/tests/unit/resources/test_token.py
utils/test/testapi/requirements.txt
utils/test/testapi/setup.py
utils/test/testapi/test-requirements.txt
utils/test/testapi/tox.ini
utils/test/testapi/update/templates/backup_mongodb.py
utils/test/testapi/update/templates/update_mongodb.py

index 436a173..1190963 100644 (file)
@@ -15,7 +15,7 @@ source $WORKSPACE/opnfv-projects.sh
 for project in "${PROJECT_LIST[@]}"
 
 do
-  cmd="anteater --project testproj --path /home/opnfv/anteater/allrepos/$project"
+  cmd="/home/opnfv/venv/bin/anteater --project testproj --path /home/opnfv/anteater/allrepos/$project"
   echo "Executing command inside container"
   echo "$cmd"
   echo "--------------------------------------------------------"
index 1778615..7a57cb5 100644 (file)
 - trigger:
     name: 'fuel-os-odl_l2-nofeature-noha-virtual-daily-master-trigger'
     triggers:
-        - timed: '' # '35 15 * * *'
+        - timed: '35 15 * * *'
 - trigger:
     name: 'fuel-os-odl_l3-nofeature-noha-virtual-daily-master-trigger'
     triggers:
-        - timed: '' # '5 18 * * *'
+        - timed: '5 18 * * *'
 - trigger:
     name: 'fuel-os-onos-sfc-noha-virtual-daily-master-trigger'
     triggers:
 - trigger:
     name: 'fuel-os-nosdn-ovs-noha-virtual-daily-master-trigger'
     triggers:
-        - timed: '' # '5 9 * * *'
+        - timed: '5 9 * * *'
 - trigger:
     name: 'fuel-os-nosdn-kvm_ovs_dpdk-noha-virtual-daily-master-trigger'
     triggers:
index 5daefa2..f6071e3 100755 (executable)
@@ -9,6 +9,10 @@ set +o pipefail
 # Prepare OpenStack credentials volume
 if [[ ${INSTALLER_TYPE} == 'joid' ]]; then
     rc_file_vol="-v $LAB_CONFIG/admin-openrc:/home/opnfv/functest/conf/openstack.creds"
+elif [[ ${INSTALLER_TYPE} == 'compass' && ${BRANCH} == 'master' ]]; then
+    cacert_file_vol="-v ${HOME}/os_cacert:/home/opnfv/functest/conf/os_cacert"
+    echo "export OS_CACERT=/home/opnfv/functest/conf/os_cacert" >> ${HOME}/opnfv-openrc.sh
+    rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds"
 else
     rc_file_vol="-v ${HOME}/opnfv-openrc.sh:/home/opnfv/functest/conf/openstack.creds"
 fi
@@ -55,7 +59,7 @@ if [[ ${INSTALLER_TYPE} == 'compass' && ${DEPLOY_SCENARIO} == *'os-nosdn-openo-h
 fi
 
 if [ "$BRANCH" != 'stable/danube' ]; then
-  volumes="${images_vol} ${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}"
+  volumes="${images_vol} ${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol} ${cacert_file_vol}"
 else
   volumes="${results_vol} ${sshkey_vol} ${stackrc_vol} ${rc_file_vol}"
 fi
index db67264..4f6044b 100644 (file)
@@ -84,7 +84,9 @@
         - shell: |
             cd ./utils/test/{module}/
             tox
-            cp *.xml $WORKSPACE
+            if [ -e *.xml ];then
+                cp *.xml $WORKSPACE
+            fi
 
     publishers:
         - publish-coverage
index 285f838..8374edb 100755 (executable)
@@ -12,7 +12,7 @@ set -o nounset
 set -o pipefail
 
 usage() {
-    echo "usage: $0 [-v] -d <destination> -i <installer_type> -a <installer_ip> [-s <ssh_key>]" >&2
+    echo "usage: $0 [-v] -d <destination> -i <installer_type> -a <installer_ip> [-o <os_cacert>] [-s <ssh_key>]" >&2
     echo "[-v] Virtualized deployment" >&2
     echo "[-s <ssh_key>] Path to ssh key. For MCP deployments only" >&2
 }
@@ -54,12 +54,13 @@ swap_to_public() {
 : ${DEPLOY_TYPE:=''}
 
 #Get options
-while getopts ":d:i:a:h:s:v" optchar; do
+while getopts ":d:i:a:h:s:o:v" optchar; do
     case "${optchar}" in
         d) dest_path=${OPTARG} ;;
         i) installer_type=${OPTARG} ;;
         a) installer_ip=${OPTARG} ;;
         s) ssh_key=${OPTARG} ;;
+        o) os_cacert=${OPTARG} ;;
         v) DEPLOY_TYPE="virt" ;;
         *) echo "Non-option argument: '-${OPTARG}'" >&2
            usage
@@ -70,6 +71,7 @@ done
 
 # set vars from env if not provided by user as options
 dest_path=${dest_path:-$HOME/opnfv-openrc.sh}
+os_cacert=${os_cacert:-$HOME/os_cacert}
 installer_type=${installer_type:-$INSTALLER_TYPE}
 installer_ip=${installer_ip:-$INSTALLER_IP}
 if [ "${installer_type}" == "fuel" ] && [ "${BRANCH}" == "master" ]; then
@@ -156,6 +158,7 @@ elif [ "$installer_type" == "compass" ]; then
     if [ "${BRANCH}" == "master" ]; then
         sudo docker cp compass-tasks:/opt/openrc $dest_path &> /dev/null
         sudo chown $(whoami):$(whoami) $dest_path
+        sudo docker cp compass-tasks:/opt/os_cacert $os_cacert &> /dev/null
     else
         verify_connectivity $installer_ip
         controller_ip=$(sshpass -p'root' ssh 2>/dev/null $ssh_options root@${installer_ip} \
index 4576d9b..da6a6cf 100644 (file)
@@ -33,6 +33,7 @@ def main(args):
     else:
         exit(1)
 
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='Create \
                                       Swagger Spec documentation')
index 8e0ae40..cb4f1d9 100644 (file)
@@ -85,5 +85,6 @@ class TestPodGet(TestPodBase):
             else:
                 self.assert_get_body(pod, self.req_e)
 
+
 if __name__ == '__main__':
     unittest.main()
index 5a2ce75..0622ba8 100644 (file)
@@ -132,5 +132,6 @@ class TestProjectDelete(TestProjectBase):
         code, body = self.get(self.req_d.name)
         self.assertEqual(code, httplib.NOT_FOUND)
 
+
 if __name__ == '__main__':
     unittest.main()
index c9d4b72..b4ba887 100644 (file)
@@ -109,5 +109,6 @@ class TestTokenUpdateProject(TestToken):
     def _update_success(self, request, body):
         self.assertIn(request.name, body)
 
+
 if __name__ == '__main__':
     unittest.main()
index 955ffc8..d2a45dc 100644 (file)
@@ -2,7 +2,7 @@
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
 
-pbr>=1.6
+pbr==2.0.0
 setuptools>=16.0
 tornado>=3.1,<=4.3
 epydoc>=0.3.1
index 15dda96..f689cb3 100644 (file)
@@ -3,7 +3,11 @@ import setuptools
 
 __author__ = 'serena'
 
+try:
+    import multiprocessing  # noqa
+except ImportError:
+    pass
 
 setuptools.setup(
-    setup_requires=['pbr>=1.8'],
+    setup_requires=['pbr==2.0.0'],
     pbr=True)
index 645687b..3bead79 100644 (file)
@@ -2,7 +2,9 @@
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
 
-mock
-pytest
 coverage
+mock>=2.0
 nose>=1.3.1
+pytest
+pytest-cov
+pytest-mock
index 81c9dfa..d300f1a 100644 (file)
@@ -4,7 +4,7 @@
 # and then run "tox" from this directory.
 
 [tox]
-envlist = py27,pep8
+envlist = pep8,py27
 skipsdist = True
 sitepackages = True
 
@@ -16,9 +16,11 @@ deps =
   -rtest-requirements.txt
 commands=
   py.test \
-    --basetemp={envtmpdir} \
-    --cov \
-    {posargs}
+  --basetemp={envtmpdir} \
+  --cov \
+  --cov-report term-missing \
+  --cov-report xml \
+  {posargs}
 setenv=
   HOME = {envtmpdir}
   PYTHONPATH = {toxinidir}
index 7e0dd55..9c24377 100644 (file)
@@ -40,5 +40,6 @@ def backup(args):
     cmd = ['mongodump', '-o', '%s' % out]
     execute(cmd, args)
 
+
 if __name__ == '__main__':
     main(backup, parser)
index ba4334a..f759592 100644 (file)
@@ -85,5 +85,6 @@ def update(args):
     rename_fields(fields_old2New)
     rename_collections(collections_old2New)
 
+
 if __name__ == '__main__':
     main(update, parser)