@@ -1,2 +1,5 @@
dist/
*.egg-info
+.tox/
+.cache/
+htmlcov
@@ -33,7 +33,9 @@ ovs_pyfiles = \
python/ovs/unixctl/server.py \
python/ovs/util.py \
python/ovs/version.py \
- python/ovs/vlog.py
+ python/ovs/vlog.py \
+ python/ovs/tests/__init__.py \
+ python/ovs/tests/test_ovs.py
# These python files are used at build time but not runtime,
# so they are not installed.
@@ -46,6 +48,12 @@ EXTRA_DIST += \
python/README.rst \
python/setup.py
+# Test suite related files
+EXTRA_DIST += \
+ python/tox.ini \
+ python/requirements.txt \
+ python/test-requirements.txt
+
PYFILES = $(ovs_pyfiles) python/ovs/dirs.py $(ovstest_pyfiles)
EXTRA_DIST += $(PYFILES)
PYCOV_CLEAN_FILES += $(PYFILES:.py=.py,cover)
new file mode 100644
@@ -0,0 +1 @@
+# This file intentionally left blank.
new file mode 100644
@@ -0,0 +1,46 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import unittest
+
+# Import everything from the ovs lib to ensure all modules show up in the
+# coverage report. It also ensures that if we don't have test coverage yet,
+# they can at least be successfully imported.
+import ovs.jsonrpc # noqa
+import ovs.tests.test_ovs # noqa
+import ovs.version # noqa
+import ovs.timeval # noqa
+import ovs.daemon # noqa
+import ovs.reconnect # noqa
+import ovs.vlog # noqa
+import ovs.json # noqa
+import ovs.stream # noqa
+import ovs.fatal_signal # noqa
+import ovs.ovsuuid # noqa
+import ovs.dirs # noqa
+import ovs.util # noqa
+import ovs.socket_util # noqa
+import ovs.process # noqa
+import ovs.poller # noqa
+import ovs.unixctl.client # noqa
+import ovs.unixctl.server # noqa
+import ovs.db.data # noqa
+import ovs.db.idl # noqa
+import ovs.db.parser # noqa
+import ovs.db.types # noqa
+import ovs.db.schema # noqa
+import ovs.db.error # noqa
+
+
+class TestOVS(unittest.TestCase):
+ def test_pass(self):
+ pass
new file mode 100644
@@ -0,0 +1 @@
+# runtime dependencies
new file mode 100644
@@ -0,0 +1,2 @@
+# test dependencies
+nose
new file mode 100644
@@ -0,0 +1,13 @@
+# Tox (http://tox.testrun.org/) is a tool for running tests
+# in multiple virtualenvs. This configuration file will run the
+# test suite on all supported python versions. To use it, "pip install tox"
+# and then run "tox" from this directory.
+
+[tox]
+envlist = py27,py34
+
+[testenv]
+usedevelop = True
+commands = {envbindir}/nosetests ovs/tests
+deps = -r{toxinidir}/requirements.txt
+ -r{toxinidir}/test-requirements.txt
tox is a tool for running Python tests in virtual Python environments. This initial setup only attempts to install the ovs Python library in both a virtual Python 2.7 environment and a virtual Python 3.4 environment. We also run the beginning of a test suite, which only imports the code. This quickly reproduces the problem that the library fails to install for Python 3. Future patches will start addressing Python 3 compatibility. Signed-off-by: Russell Bryant <russell@ovn.org> --- python/.gitignore | 3 +++ python/automake.mk | 10 +++++++++- python/ovs/tests/__init__.py | 1 + python/ovs/tests/test_ovs.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ python/requirements.txt | 1 + python/test-requirements.txt | 2 ++ python/tox.ini | 13 +++++++++++++ 7 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 python/ovs/tests/__init__.py create mode 100644 python/ovs/tests/test_ovs.py create mode 100644 python/requirements.txt create mode 100644 python/test-requirements.txt create mode 100644 python/tox.ini