summaryrefslogtreecommitdiff
path: root/test/api
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2018-05-18 16:16:40 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2018-05-18 16:25:44 +0200
commit3bbdde808a9dcb55a9ffd092e931dff80814daa7 (patch)
tree4b9ed60f94ca108e0e1d7bc34f952f9221adf5da /test/api
parentfbf64fe730ffa27ee94867017742174f270d3fa0 (diff)
downloadlvm2-3bbdde808a9dcb55a9ffd092e931dff80814daa7.tar.gz
tests: pick either python2 or python3 .so
Use matching PYTHON library implementation.
Diffstat (limited to 'test/api')
-rw-r--r--test/api/pytest.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/api/pytest.sh b/test/api/pytest.sh
index bf31b39ca..ed9df5e70 100644
--- a/test/api/pytest.sh
+++ b/test/api/pytest.sh
@@ -31,7 +31,11 @@ aux prepare_dmeventd
#Locate the python binding library to use.
if [[ -n "${abs_top_builddir+varset}" ]]; then
- python_lib=($(find "$abs_top_builddir" -name lvm*.so))
+ # For python2 look for lvm.so, python3 uses some lengthy names
+ case "$(head -1 $(which python_lvm_unit.py) )" in
+ *2) python_lib=($(find "$abs_top_builddir" -name lvm.so)) ;;
+ *) python_lib=($(find "$abs_top_builddir" -name lvm*gnu.so)) ;;
+ esac
if [[ ${#python_lib[*]} -ne 1 ]]; then
if [[ ${#python_lib[*]} -gt 1 ]]; then
# Unable to test python bindings if multiple libraries found:
@@ -58,9 +62,9 @@ aux prepare_pvs 6
PY_UNIT_PVS=$(cat DEVICES)
export PY_UNIT_PVS
-python_lvm_unit.py -v -f TestLvm.test_lv_persistence
-exit
-#python_lvm_unit.py -v -f
+#When needed to run 1 single individual python test
+#python_lvm_unit.py -v -f TestLvm.test_lv_persistence
+#exit
# Run individual tests for shorter error trace
for i in \