]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: fix python tests for dist and out-of-tree builds
authorRuediger Meier <ruediger.meier@ga-group.nl>
Tue, 3 Jun 2014 22:17:58 +0000 (00:17 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Wed, 4 Jun 2014 08:14:24 +0000 (10:14 +0200)
- add python helper scripts to the dist
- helper scripts are always in srcdir
- python libs are in builddir
- abort tests if helpers are missing

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Makefile.am
libmount/python/Makemodule.am
tests/commands.sh
tests/functions.sh
tests/ts/libmount/context-py
tests/ts/libmount/context-utab-py
tests/ts/libmount/tabfiles-py
tests/ts/libmount/tabfiles-tags-py
tests/ts/libmount/update-py

index 73ec1e2cbac19532261b819f3764288d7a6348c7..5f99c8c3cdcaa8b86b016e1606f6b7bc6d4aab93 100644 (file)
@@ -46,6 +46,7 @@ dist_usrbin_exec_SCRIPTS =
 systemdsystemunit_DATA =
 dist_bashcompletion_DATA =
 check_PROGRAMS =
+dist_check_SCRIPTS =
 TESTS =
 
 PATHFILES =
index aeb76d75f3cab2fe3a6c110a7402fefc256dc030..367d324729f4d0ca6c82d7a18ca7829fe852f954 100644 (file)
@@ -26,6 +26,10 @@ pylibmount_la_CFLAGS = \
 pylibmount_la_LDFLAGS = \
        -avoid-version -module -shared -export-dynamic
 
+dist_check_SCRIPTS += libmount/python/test_mount_context.py
+dist_check_SCRIPTS += libmount/python/test_mount_tab.py
+dist_check_SCRIPTS += libmount/python/test_mount_tab_update.py
+
 CLEANFILES += *.img
 
 endif # BUILD_PYLIBMOUNT
index b541af0ae8d90a8be15d3f345d74ff74b0905d84..06450a36709e2b6a648b509b96c658ecb1b6dd80 100644 (file)
@@ -13,9 +13,9 @@ TS_HELPER_LIBMOUNT_TABDIFF="$top_builddir/test_mount_tab_diff"
 TS_HELPER_LIBMOUNT_TAB="$top_builddir/test_mount_tab"
 TS_HELPER_LIBMOUNT_UPDATE="$top_builddir/test_mount_tab_update"
 TS_HELPER_LIBMOUNT_UTILS="$top_builddir/test_mount_utils"
-TS_HELPER_PYLIBMOUNT_CONTEXT="$top_builddir/libmount/python/test_mount_context.py"
-TS_HELPER_PYLIBMOUNT_TAB="$top_builddir/libmount/python/test_mount_tab.py"
-TS_HELPER_PYLIBMOUNT_UPDATE="$top_builddir/libmount/python/test_mount_tab_update.py"
+TS_HELPER_PYLIBMOUNT_CONTEXT="$top_srcdir/libmount/python/test_mount_context.py"
+TS_HELPER_PYLIBMOUNT_TAB="$top_srcdir/libmount/python/test_mount_tab.py"
+TS_HELPER_PYLIBMOUNT_UPDATE="$top_srcdir/libmount/python/test_mount_tab_update.py"
 TS_HELPER_LOGINDEFS="$top_builddir/test_logindefs"
 TS_HELPER_MD5="$top_builddir/test_md5"
 TS_HELPER_MORE=${TS_HELPER_MORE-"$top_builddir/test_more"}
index 85f0e0fac896c1a9fed2ff49d7fd64e4ccb51b3a..31ad481f49a21aa8bc4fdfb492bd091ea6338c59 100644 (file)
@@ -316,10 +316,10 @@ function ts_init_suid {
 function ts_init_py {
        LIBNAME="$1"
 
-       [ -f "$TS_TOPDIR/../py${LIBNAME}.la" ] || ts_skip "py${LIBNAME} not compiled"
+       [ -f "$top_builddir/py${LIBNAME}.la" ] || ts_skip "py${LIBNAME} not compiled"
 
-       export LD_LIBRARY_PATH="$TS_TOPDIR/../.libs"
-       export PYTHONPATH="$TS_TOPDIR/../$LIBNAME/python:$TS_TOPDIR/../.libs"
+       export LD_LIBRARY_PATH="$top_builddir/.libs"
+       export PYTHONPATH="$top_builddir/$LIBNAME/python:$top_builddir/.libs"
 
        export PYTHON_VERSION=$(awk '/^PYTHON_VERSION/ { print $3 }' $top_builddir/Makefile)
        export PYTHON_MAJOR_VERSION=$(echo $PYTHON_VERSION | sed 's/\..*//')
index e8faa7242d5f07583f7eb38f4a36864e3566441a..b2355a7955c6d766fd7e16a574c1ce4e60c877c8 100755 (executable)
@@ -20,6 +20,7 @@ ts_init_py libmount
 ts_skip_nonroot
 
 TESTPROG="$TS_HELPER_PYLIBMOUNT_CONTEXT"
+[ -x $TESTPROG ] || ts_die "test script missing"
 
 PYDBG="$PYTHON -m pdb"
 LABEL=libmount-test
index 8f8c3799248820f4ff85338ae07d87c1c65b5974..00af69554eee8391ea5dc5249f405e0c4b5ddbfd 100755 (executable)
@@ -18,6 +18,8 @@ ts_skip_nonroot
 
 
 TESTPROG="$TS_HELPER_PYLIBMOUNT_CONTEXT"
+[ -x $TESTPROG ] || ts_die "test script missing"
+
 LABEL=libmount-test
 UUID=$($TS_CMD_UUIDGEN)
 MOUNTPOINT="$TS_MOUNTPOINT"
index c5ca1c56332e6dfbc3584dd6a31b8b9f1efe292e..f0c4836d0e8a082fb1be51cce2f7fefd154fc975 100755 (executable)
@@ -11,6 +11,7 @@ ts_init_py libmount
 
 PYDBG="$PYTHON -m pdb"
 TESTPROG="$TS_HELPER_PYLIBMOUNT_TAB"
+[ -x $TESTPROG ] || ts_die "test script missing"
 
 ts_init_subtest "parse-fstab"
 $PYTHON $TESTPROG --parse "$TS_SELF/files/fstab" &> $TS_OUTPUT
index 982cc0001a6bbc8607d341c1c0032d352769d83b..2f462a0aff58c6b274182c12614cdc8c810553e5 100755 (executable)
@@ -9,6 +9,8 @@ ts_init_py libmount
 ts_skip_nonroot
 
 TESTPROG="$TS_HELPER_PYLIBMOUNT_TAB"
+[ -x $TESTPROG ] || ts_die "test script missing"
+
 ts_check_prog "mkfs.ext3"
 
 PYDBG="$PYTHON -m pdb"
index da14b9bae95b00c2a88a5b9b3eb1deec01768282..6493224fb46873ee6fbe3b0df5a68db68559b83c 100755 (executable)
@@ -11,8 +11,7 @@ ts_init_py libmount
 ts_skip_nonroot
 
 TESTPROG="$TS_HELPER_PYLIBMOUNT_UPDATE"
-
-[ -x $TESTPROG ] || ts_skip "test not compiled"
+[ -x $TESTPROG ] || ts_die "test script missing"
 
 #
 # fstab - replace