diff options
author | Karel Zak | 2016-04-15 14:10:23 +0200 |
---|---|---|
committer | Karel Zak | 2016-04-15 14:10:23 +0200 |
commit | edeb6223fed8f5e5b4088d34007c3860c928906a (patch) | |
tree | 0fca6757299369352bc8ca166d8aa890d5e9b805 /tests/ts/libmount | |
parent | libmount: fix mnt_table_parse_mtab() logic (diff) | |
download | kernel-qcow2-util-linux-edeb6223fed8f5e5b4088d34007c3860c928906a.tar.gz kernel-qcow2-util-linux-edeb6223fed8f5e5b4088d34007c3860c928906a.tar.xz kernel-qcow2-util-linux-edeb6223fed8f5e5b4088d34007c3860c928906a.zip |
tests: make tests more portable due to mtab
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/libmount')
-rwxr-xr-x | tests/ts/libmount/context | 4 | ||||
-rwxr-xr-x | tests/ts/libmount/context-py | 4 | ||||
-rwxr-xr-x | tests/ts/libmount/update | 64 |
3 files changed, 38 insertions, 34 deletions
diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context index 2566ccb53..bcb9534e8 100755 --- a/tests/ts/libmount/context +++ b/tests/ts/libmount/context @@ -36,8 +36,8 @@ ts_scsi_debug_init dev_size_mb=100 DEVNAME=$(basename $TS_DEVICE) MOUNTINFO_ONLY=yes -grep -q '#define USE_LIBMOUNT_SUPPORT_MTAB' ${top_builddir}/config.h -if [ $? == 0 ]; then +has_mtab=$( ts_has_mtab_support ) +if [ "$has_mtab" == "yes" ]; then MOUNTINFO_ONLY=no fi diff --git a/tests/ts/libmount/context-py b/tests/ts/libmount/context-py index 5188309be..66b2eec52 100755 --- a/tests/ts/libmount/context-py +++ b/tests/ts/libmount/context-py @@ -38,8 +38,8 @@ ts_scsi_debug_init dev_size_mb=100 DEVNAME=$(basename $TS_DEVICE) MOUNTINFO_ONLY=yes -grep -q '#define USE_LIBMOUNT_SUPPORT_MTAB' ${top_builddir}/config.h -if [ $? == 0 ]; then +has_mtab=$( ts_has_mtab_support ) +if [ "$has_mtab" == "yes" ]; then MOUNTINFO_ONLY=no fi diff --git a/tests/ts/libmount/update b/tests/ts/libmount/update index 89279ba26..1db16d99f 100755 --- a/tests/ts/libmount/update +++ b/tests/ts/libmount/update @@ -21,41 +21,45 @@ TESTPROG="$TS_HELPER_LIBMOUNT_UPDATE" # # - all this test uses global $TS_OUTPUT.{mtab,mountinfo} - -# -# Traditional /etc/mtab -# export LIBMOUNT_MTAB=$TS_OUTPUT.mtab rm -f $LIBMOUNT_MTAB > $LIBMOUNT_MTAB -ts_init_subtest "mtab-mount" -ts_valgrind $TESTPROG --add /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec" -ts_valgrind $TESTPROG --add /dev/sdb1 /mnt/bar ext3 "gg=G,ffff=f,ro,noatime" -ts_valgrind $TESTPROG --add /dev/sda2 /mnt/bar ext3 "rw,noatime" -ts_valgrind $TESTPROG --add /dev/sda1 /mnt/gogo ext3 "rw,noatime,nosuid" -ts_valgrind $TESTPROG --add none /proc proc defaults -cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside -ts_finalize_subtest # checks the mtab - -ts_init_subtest "mtab-move" -ts_valgrind $TESTPROG --move /mnt/foo /mnt/newfoo -ts_valgrind $TESTPROG --move /mnt/bar /mnt/newbar -cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside -ts_finalize_subtest # checks the mtab - -ts_init_subtest "mtab-remount" -ts_valgrind $TESTPROG --remount /mnt/newfoo "ro,noatime" -ts_valgrind $TESTPROG --remount /mnt/bar "rw,atime,nosuid" -cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside -ts_finalize_subtest # checks the mtab -ts_init_subtest "mtab-umount" -ts_valgrind $TESTPROG --remove /mnt/bar -ts_valgrind $TESTPROG --remove /mnt/gogo -ts_valgrind $TESTPROG --remove /proc -cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside -ts_finalize_subtest # checks the mtab +# +# Traditional /etc/mtab +# +has_mtab=$( ts_has_mtab_support ) +if [ "$has_mtab" == "yes" ]; then + + ts_init_subtest "mtab-mount" + ts_valgrind $TESTPROG --add /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec" + ts_valgrind $TESTPROG --add /dev/sdb1 /mnt/bar ext3 "gg=G,ffff=f,ro,noatime" + ts_valgrind $TESTPROG --add /dev/sda2 /mnt/bar ext3 "rw,noatime" + ts_valgrind $TESTPROG --add /dev/sda1 /mnt/gogo ext3 "rw,noatime,nosuid" + ts_valgrind $TESTPROG --add none /proc proc defaults + cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside + ts_finalize_subtest # checks the mtab + + ts_init_subtest "mtab-move" + ts_valgrind $TESTPROG --move /mnt/foo /mnt/newfoo + ts_valgrind $TESTPROG --move /mnt/bar /mnt/newbar + cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside + ts_finalize_subtest # checks the mtab + + ts_init_subtest "mtab-remount" + ts_valgrind $TESTPROG --remount /mnt/newfoo "ro,noatime" + ts_valgrind $TESTPROG --remount /mnt/bar "rw,atime,nosuid" + cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside + ts_finalize_subtest # checks the mtab + + ts_init_subtest "mtab-umount" + ts_valgrind $TESTPROG --remove /mnt/bar + ts_valgrind $TESTPROG --remove /mnt/gogo + ts_valgrind $TESTPROG --remove /proc + cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside + ts_finalize_subtest # checks the mtab +fi # # utab |