From: Nir Soffer <nsoffer(a)redhat.com>
This series improve the testing infrastructre and fix the build so we
can add python bindings tests with a running sanlock daemon.
First, the various test helper functions moved to new test/util.py
module, since we use them from both direct and daemon tests, and the new
python tests will need them as well.
The sanlock_daemon fixuture is also needed for testing the python
bindings with a running sanlock daemon, so it move to a new conftest.py,
the stanrad location for project pytest fixtures.
To help the python binding find libsanlock.so in runtime, we must start
python with LD_LIBRARY_PATH set. To help it to find sanlock run
directory, we need also SANLOCK_RUN_DIR. Since we need the environment
variables both for the python test process, and for the sanlock daemon
and client running by the tests, it is better to set the environment
before starting the tests, instead of inside the tests. A new
tests/env.sh script added to make it easy.
When building python binding on Travis CI, I found that libsanlock.so
was not linked correctly, failing to load with undefined symbol. This
was fixed by moving the libraries to the correct place in the compile
command.
Finally a new python test module was added, testing
sanlock.write_lockspace().
The patches created on top of:
commit aa3ebd88204b5b37ba0ff839dc209aad0e7b867a
Author: Nir Soffer <nsoffer(a)redhat.com>
Date: Fri Jan 12 23:45:42 2018 +0200
Normalize sanlock exit code
Nir Soffer (5):
Introduce tests.util module
Introduce conftest module
Move environment setup to a shell script
Fix libsanlock build on Unubtu/Debian
Start python binding test module
.travis.yml | 5 ++-
README.dev | 9 +++--
python/Makefile | 3 ++
src/Makefile | 4 +--
tests/__init__.py | 0
tests/conftest.py | 21 ++++++++++++
tests/daemon_test.py | 93 +++++-----------------------------------------------
tests/direct_test.py | 11 ++-----
tests/env.sh | 16 +++++++++
tests/python_test.py | 27 +++++++++++++++
tests/util.py | 77 +++++++++++++++++++++++++++++++++++++++++++
11 files changed, 164 insertions(+), 102 deletions(-)
create mode 100644 tests/__init__.py
create mode 100644 tests/conftest.py
create mode 100644 tests/env.sh
create mode 100644 tests/python_test.py
create mode 100644 tests/util.py
--
2.9.5