From 9ee9b136ebec5d21f5165acc5e4441c3e91a56dd Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 26 Jul 2017 12:43:00 +0200 Subject: Add doctor-test package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also updates test-requirements.txt to conform with OpenStack stable/ocata and renames it requirements.txt. tests.main:main is considered as entry point and run.sh as script. run.sh could be renamed to avoid possible conflicts in functest. tox.ini is updated to pin the right versions and build files are filtered. The next dependencies can be safely removed: - paramiko - scp - python-openstackclient - python-ceilometerclient - virtualenv Change-Id: I2091cfe4751640bf83d77e1fdd713af1e31fa89d Signed-off-by: Cédric Ollivier --- .gitignore | 3 +++ requirements.txt | 14 ++++++++++++++ setup.cfg | 13 +++++++++++++ setup.py | 22 ++++++++++++++++++++++ test-requirements.txt | 14 -------------- tests/__init__.py | 0 tests/main.py | 4 ---- tox.ini | 10 ++++++---- 8 files changed, 58 insertions(+), 22 deletions(-) create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py delete mode 100644 test-requirements.txt create mode 100644 tests/__init__.py diff --git a/.gitignore b/.gitignore index 84d085d8..83868b54 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/tests/main.py b/tests/main.py index 797e28b2..7714d7da 100644 --- a/tests/main.py +++ b/tests/main.py @@ -92,7 +92,3 @@ def main(): doctor = DoctorTest(conf) doctor.run() - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/tox.ini b/tox.ini index e75a3741..c6262ed5 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -21,5 +24,4 @@ passenv = PYTHON_ENABLE CI_DEBUG changedir = {toxinidir}/tests -commands = python main.py - +commands = doctor-test -- cgit 1.2.3-korg