Add doctor-test package 77/38177/4
authorCédric Ollivier <cedric.ollivier@orange.com>
Wed, 26 Jul 2017 10:43:00 +0000 (12:43 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Fri, 28 Jul 2017 09:34:23 +0000 (11:34 +0200)
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 <cedric.ollivier@orange.com>
.gitignore
requirements.txt [new file with mode: 0644]
setup.cfg [new file with mode: 0644]
setup.py [new file with mode: 0644]
test-requirements.txt [deleted file]
tests/__init__.py [new file with mode: 0644]
tests/main.py
tox.ini

index 84d085d..83868b5 100644 (file)
@@ -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 (file)
index 0000000..4623289
--- /dev/null
@@ -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 (file)
index 0000000..d294cf3
--- /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 (file)
index 0000000..a1e9b3b
--- /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 (file)
index 070caa4..0000000
+++ /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 (file)
index 0000000..e69de29
index 797e28b..7714d7d 100644 (file)
@@ -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 e75a374..c6262ed 100644 (file)
--- 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