diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | requirements.txt | 14 | ||||
-rw-r--r-- | setup.cfg | 13 | ||||
-rw-r--r-- | setup.py | 22 | ||||
-rw-r--r-- | test-requirements.txt | 14 | ||||
-rw-r--r-- | tests/__init__.py | 0 | ||||
-rw-r--r-- | tests/main.py | 4 | ||||
-rwxr-xr-x | tests/run.sh | 12 | ||||
-rw-r--r-- | tox.ini | 10 |
9 files changed, 65 insertions, 27 deletions
@@ -2,6 +2,9 @@ *.pyc .*.sw? **.log +*.pyc +/*.egg-info/ +/build/ /docs_build/ /docs_output/ /releng/ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..4623289d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,14 @@ +Flask!=0.11,<1.0,>=0.10 # BSD +paramiko>=2.0 # LGPLv2.1+ +scp +requests!=2.12.2,>=2.10.0 # Apache-2.0 +oslo.config!=3.18.0,>=3.14.0 # Apache-2.0 +python-openstackclient>=3.3.0 # Apache-2.0 +python-ceilometerclient>=2.5.0 # Apache-2.0 +aodhclient>=0.7.0 # Apache-2.0 +python-keystoneclient>=3.8.0 # Apache-2.0 +python-neutronclient>=5.1.0 # Apache-2.0 +python-novaclient!=7.0.0,>=6.0.0 # Apache-2.0 +python-congressclient<2000,>=1.3.0 # Apache-2.0 +python-glanceclient>=2.5.0 # Apache-2.0 +virtualenv>=13.1.0 # MIT diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..d294cf38 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,13 @@ +[metadata] +name = doctor-test +version = 2017.9.0 +home-page = https://wiki.opnfv.org/display/doctor/Doctor+Home + +[files] +packages = tests +scripts = + tests/run.sh + +[entry_points] +console_scripts = + doctor-test = tests.main:main diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..a1e9b3bb --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Copyright (c) 2017 Orange and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + +import setuptools + +# In python < 2.7.4, a lazy loading of package `pbr` will break +# setuptools if some other modules registered functions in `atexit`. +# solution from: http://bugs.python.org/issue15881#msg170215 +try: + import multiprocessing # noqa +except ImportError: + pass + +setuptools.setup( + setup_requires=['pbr>=1.8'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 070caa44..00000000 --- a/test-requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ -Flask==0.10.1 -paramiko==1.16.0 -scp==0.10.2 -requests>=2.8.0 -oslo.config==3.22.0 # Apache-2.0 -python-openstackclient==2.3.0 -python-ceilometerclient==2.6.2 -aodhclient==0.7.0 -python-keystoneclient==3.5.0 -python-neutronclient==6.0.0 -python-novaclient==6.0.0 -python-congressclient==1.5.0 -python-glanceclient==2.5.0 -virtualenv==15.1.0 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/__init__.py diff --git a/tests/main.py b/tests/main.py index df7e95f3..edff16f2 100644 --- a/tests/main.py +++ b/tests/main.py @@ -211,7 +211,3 @@ def main(): doctor = DoctorTest(conf) doctor.run() - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/tests/run.sh b/tests/run.sh index e1875e09..b5c56872 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -42,6 +42,8 @@ ceilometer="ceilometer $as_doctor_user" as_admin_user="--os-username admin --os-project-name $DOCTOR_PROJECT --os-tenant-name $DOCTOR_PROJECT" +upper_constraints="https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata" +pip_install="pip install -c${upper_constraints}" # Functions @@ -477,16 +479,16 @@ cleanup() { } setup_python_packages() { - sudo pip install flask==0.10.1 - command -v openstack || sudo pip install python-openstackclient==2.3.0 - command -v ceilometer || sudo pip install python-ceilometerclient==2.6.2 - command -v congress || sudo pip install python-congressclient==1.5.0 + pip freeze |grep -i flask\= > /dev/null || sudo ${pip_install} flask + command -v openstack || sudo ${pip_install} python-openstackclient + command -v ceilometer || sudo ${pip_install} python-ceilometerclient + command -v congress || sudo ${pip_install} python-congressclient } # Main process if [[ $PYTHON_ENABLE == [Tt]rue ]]; then - which tox || sudo pip install tox + which tox || sudo ${pip_install} tox if [ -f /usr/bin/apt-get ]; then sudo apt-get install -y python3-dev elif [ -f /usr/bin/yum ] ; then @@ -4,9 +4,12 @@ envlist = py34 skipsdist = True [testenv] -install_command = pip install -U {opts} {packages} +usedevelop = True +install_command = pip install \ + -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata \ + {opts} {packages} setenv = VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/test-requirements.txt +deps = -r{toxinidir}/requirements.txt passenv = OS_AUTH_URL OS_USERNAME @@ -24,5 +27,4 @@ passenv = INSTALLER_IP PROFILER_TYPE changedir = {toxinidir}/tests -commands = python main.py - +commands = doctor-test |