To be able to write unittests, add a tox.ini (for testing in venvs)
and a first single test case as example.
Tests can be executed with eg:
$ tox
Or by running the usual:
$ ./run-make-check.sh
Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
add_subdirectory(pybind)
add_subdirectory(ceph-volume)
add_subdirectory(python-common)
+add_subdirectory(ceph-daemon)
# Monitor
add_subdirectory(mon)
--- /dev/null
+if(WITH_TESTS)
+ include(AddCephTest)
+ add_tox_test(ceph-daemon TOX_ENVS)
+endif()
--- /dev/null
+import imp
+import unittest
+
+
+cd = imp.load_source("ceph-daemon", "ceph-daemon")
+
+
+class TestCephDaemon(unittest.TestCase):
+ def test_is_fsid(self):
+ self.assertFalse(cd.is_fsid('no-uuid'))
--- /dev/null
+[tox]
+envlist = py27, py3
+
+[testenv]
+skipsdist=true
+skip_install=true
+deps = pytest
+commands=pytest {posargs}