diff options
-rw-r--r-- | tests/functions.sh | 9 | ||||
-rwxr-xr-x | tests/ts/libmount/context-py | 5 | ||||
-rwxr-xr-x | tests/ts/libmount/context-utab-py | 5 | ||||
-rwxr-xr-x | tests/ts/libmount/tabfiles-py | 5 | ||||
-rwxr-xr-x | tests/ts/libmount/tabfiles-tags-py | 3 |
5 files changed, 13 insertions, 14 deletions
diff --git a/tests/functions.sh b/tests/functions.sh index 2ca98f8ca..361ab7075 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -242,6 +242,15 @@ function ts_init_suid { chmod u+s $PROG &> /dev/null } +function ts_init_py { + LIBNAME="$1" + + [ -f "$TS_TOPDIR/../$LIBNAME.la" ] || ts_skip "py$LIBNAME not compiled" + + export LD_LIBRARY_PATH="$TS_TOPDIR/../.libs" + export PYTHONPATH="$TS_TOPDIR/../$LIBNAME/python:$TS_TOPDIR/../.libs" +} + function ts_valgrind { if [ -z "$TS_VALGRIND_CMD" ]; then $* diff --git a/tests/ts/libmount/context-py b/tests/ts/libmount/context-py index 20f56ec31..09e705009 100755 --- a/tests/ts/libmount/context-py +++ b/tests/ts/libmount/context-py @@ -3,13 +3,12 @@ # Copyright (C) 2010 Karel Zak <kzak@redhat.com> TS_TOPDIR="$(dirname $0)/../.." -export LD_LIBRARY_PATH="$TS_TOPDIR/../.libs" -export PYTHONPATH="$TS_TOPDIR/../libmount/python:$TS_TOPDIR/../.libs" TS_DESC="context-py" PYDBG="python -m pdb" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_init_py libmount ts_skip_nonroot TESTPROG="$TS_HELPER_PYLIBMOUNT_CONTEXT" @@ -19,8 +18,6 @@ MOUNTPOINT="$TS_MOUNTPOINT" TS_NOEXIST="$TS_OUTDIR/${TS_TESTNAME}-${TS_SUBNAME}-noex" [ -d $TS_NOEXIST ] && rmdir $TS_NOEXIST -[ -x $TESTPROG ] || ts_skip "test not compiled" - ts_log "Init device" umount $MOUNTPOINT &> /dev/null diff --git a/tests/ts/libmount/context-utab-py b/tests/ts/libmount/context-utab-py index 2b0d21d0c..b2c0e2ed0 100755 --- a/tests/ts/libmount/context-utab-py +++ b/tests/ts/libmount/context-utab-py @@ -2,12 +2,11 @@ # Copyright (C) 2010 Karel Zak <kzak@redhat.com> TS_TOPDIR="$(dirname $0)/../.." -export LD_LIBRARY_PATH="$TS_TOPDIR/../.libs" -export PYTHONPATH="$TS_TOPDIR/../libmount/python:$TS_TOPDIR/../.libs" TS_DESC="context-py (utab)" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_init_py libmount ts_skip_nonroot TESTPROG="$TS_HELPER_PYLIBMOUNT_CONTEXT" @@ -15,8 +14,6 @@ LABEL=libmount-test UUID=$(uuidgen) MOUNTPOINT="$TS_MOUNTPOINT" -[ -x $TESTPROG ] || ts_skip "test not compiled" - DEVICE=$(ts_scsi_debug_init dev_size_mb=100) DEVNAME=$(basename $DEVICE) diff --git a/tests/ts/libmount/tabfiles-py b/tests/ts/libmount/tabfiles-py index 86e7766ba..596a1b8fa 100755 --- a/tests/ts/libmount/tabfiles-py +++ b/tests/ts/libmount/tabfiles-py @@ -3,18 +3,15 @@ # Copyright (C) 2010 Karel Zak <kzak@redhat.com> TS_TOPDIR="$(dirname $0)/../.." -export LD_LIBRARY_PATH="$TS_TOPDIR/../.libs" -export PYTHONPATH="$TS_TOPDIR/../libmount/python:$TS_TOPDIR/../.libs" TS_DESC="tab files-py" PYDBG="python -m pdb" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_init_py libmount TESTPROG="$TS_HELPER_PYLIBMOUNT_TAB" -[ -x $TESTPROG ] || ts_skip "test not compiled" - ts_init_subtest "parse-fstab" $TESTPROG --parse "$TS_SELF/files/fstab" &> $TS_OUTPUT sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT diff --git a/tests/ts/libmount/tabfiles-tags-py b/tests/ts/libmount/tabfiles-tags-py index 65d832541..9f1d19cfe 100755 --- a/tests/ts/libmount/tabfiles-tags-py +++ b/tests/ts/libmount/tabfiles-tags-py @@ -8,12 +8,11 @@ PYDBG="python -m pdb" . $TS_TOPDIR/functions.sh ts_init "$*" +ts_init_py libmount ts_skip_nonroot TESTPROG="$TS_HELPER_PYLIBMOUNT_TAB" -[ -x $TESTPROG ] || ts_skip "test not compiled" - DEVICE=$(ts_scsi_debug_init dev_size_mb=50 sector_size=512) LABEL="testLibmount" UUID="de1bc6e9-34ab-4151-a1d7-900042eee8d9" |