diff options
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/fetch_os_creds.sh | 7 | ||||
-rw-r--r-- | utils/test/testapi/htmlize/htmlize.py | 1 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/resources/test_pod.py | 1 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/resources/test_project.py | 1 | ||||
-rw-r--r-- | utils/test/testapi/opnfv_testapi/tests/unit/resources/test_token.py | 1 | ||||
-rw-r--r-- | utils/test/testapi/requirements.txt | 2 | ||||
-rw-r--r-- | utils/test/testapi/setup.py | 6 | ||||
-rw-r--r-- | utils/test/testapi/test-requirements.txt | 6 | ||||
-rw-r--r-- | utils/test/testapi/tox.ini | 10 | ||||
-rw-r--r-- | utils/test/testapi/update/templates/backup_mongodb.py | 1 | ||||
-rw-r--r-- | utils/test/testapi/update/templates/update_mongodb.py | 1 |
11 files changed, 27 insertions, 10 deletions
diff --git a/utils/fetch_os_creds.sh b/utils/fetch_os_creds.sh index 285f838db..8374edbbd 100755 --- a/utils/fetch_os_creds.sh +++ b/utils/fetch_os_creds.sh @@ -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} \ diff --git a/utils/test/testapi/htmlize/htmlize.py b/utils/test/testapi/htmlize/htmlize.py index 4576d9bb0..da6a6cf91 100644 --- a/utils/test/testapi/htmlize/htmlize.py +++ b/utils/test/testapi/htmlize/htmlize.py @@ -33,6 +33,7 @@ def main(args): else: exit(1) + if __name__ == '__main__': parser = argparse.ArgumentParser(description='Create \ Swagger Spec documentation') diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_pod.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_pod.py index 8e0ae407d..cb4f1d92c 100644 --- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_pod.py +++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_pod.py @@ -85,5 +85,6 @@ class TestPodGet(TestPodBase): else: self.assert_get_body(pod, self.req_e) + if __name__ == '__main__': unittest.main() diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_project.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_project.py index 5a2ce7522..0622ba8d4 100644 --- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_project.py +++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_project.py @@ -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() diff --git a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_token.py b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_token.py index c9d4b72c4..b4ba88742 100644 --- a/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_token.py +++ b/utils/test/testapi/opnfv_testapi/tests/unit/resources/test_token.py @@ -109,5 +109,6 @@ class TestTokenUpdateProject(TestToken): def _update_success(self, request, body): self.assertIn(request.name, body) + if __name__ == '__main__': unittest.main() diff --git a/utils/test/testapi/requirements.txt b/utils/test/testapi/requirements.txt index 955ffc853..d2a45dcd0 100644 --- a/utils/test/testapi/requirements.txt +++ b/utils/test/testapi/requirements.txt @@ -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 diff --git a/utils/test/testapi/setup.py b/utils/test/testapi/setup.py index 15dda961f..f689cb30e 100644 --- a/utils/test/testapi/setup.py +++ b/utils/test/testapi/setup.py @@ -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) diff --git a/utils/test/testapi/test-requirements.txt b/utils/test/testapi/test-requirements.txt index 645687b14..3bead7987 100644 --- a/utils/test/testapi/test-requirements.txt +++ b/utils/test/testapi/test-requirements.txt @@ -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 diff --git a/utils/test/testapi/tox.ini b/utils/test/testapi/tox.ini index 81c9dfab1..d300f1a61 100644 --- a/utils/test/testapi/tox.ini +++ b/utils/test/testapi/tox.ini @@ -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} diff --git a/utils/test/testapi/update/templates/backup_mongodb.py b/utils/test/testapi/update/templates/backup_mongodb.py index 7e0dd5545..9c2437764 100644 --- a/utils/test/testapi/update/templates/backup_mongodb.py +++ b/utils/test/testapi/update/templates/backup_mongodb.py @@ -40,5 +40,6 @@ def backup(args): cmd = ['mongodump', '-o', '%s' % out] execute(cmd, args) + if __name__ == '__main__': main(backup, parser) diff --git a/utils/test/testapi/update/templates/update_mongodb.py b/utils/test/testapi/update/templates/update_mongodb.py index ba4334aa3..f75959281 100644 --- a/utils/test/testapi/update/templates/update_mongodb.py +++ b/utils/test/testapi/update/templates/update_mongodb.py @@ -85,5 +85,6 @@ def update(args): rename_fields(fields_old2New) rename_collections(collections_old2New) + if __name__ == '__main__': main(update, parser) |