From 0e7abd33c71d590a3823d6e8ce6d79beee2abefe Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 8 Nov 2010 12:22:01 +0100 Subject: [PATCH] tests: add utab update tests Signed-off-by: Karel Zak --- tests/expected/libmount/update-utab-mount | 2 ++ tests/expected/libmount/update-utab-move | 2 ++ tests/expected/libmount/update-utab-remount | 2 ++ tests/expected/libmount/update-utab-umount | 1 + tests/ts/libmount/update | 36 +++++++++++++++++++-- 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 tests/expected/libmount/update-utab-mount create mode 100644 tests/expected/libmount/update-utab-move create mode 100644 tests/expected/libmount/update-utab-remount create mode 100644 tests/expected/libmount/update-utab-umount diff --git a/tests/expected/libmount/update-utab-mount b/tests/expected/libmount/update-utab-mount new file mode 100644 index 00000000..0464c749 --- /dev/null +++ b/tests/expected/libmount/update-utab-mount @@ -0,0 +1,2 @@ +0 0 0:0 / /mnt/bar user - ext3 /dev/sdb1 none +0 0 0:0 / /mnt/xyz loop=/dev/loop0,uhelper=hal - ext3 /dev/sda2 none diff --git a/tests/expected/libmount/update-utab-move b/tests/expected/libmount/update-utab-move new file mode 100644 index 00000000..bdcf9cb3 --- /dev/null +++ b/tests/expected/libmount/update-utab-move @@ -0,0 +1,2 @@ +0 0 0:0 / /mnt/newbar user - ext3 /dev/sdb1 none +0 0 0:0 / /mnt/newxyz loop=/dev/loop0,uhelper=hal - ext3 /dev/sda2 none diff --git a/tests/expected/libmount/update-utab-remount b/tests/expected/libmount/update-utab-remount new file mode 100644 index 00000000..853d9fbe --- /dev/null +++ b/tests/expected/libmount/update-utab-remount @@ -0,0 +1,2 @@ +0 0 0:0 / /mnt/newbar user - ext3 /dev/sdb1 none +0 0 0:0 / /mnt/newxyz user - ext3 /dev/sda2 none diff --git a/tests/expected/libmount/update-utab-umount b/tests/expected/libmount/update-utab-umount new file mode 100644 index 00000000..b8c096bf --- /dev/null +++ b/tests/expected/libmount/update-utab-umount @@ -0,0 +1 @@ +0 0 0:0 / /mnt/newxyz user - ext3 /dev/sda2 none diff --git a/tests/ts/libmount/update b/tests/ts/libmount/update index 7de94251..92c92b08 100755 --- a/tests/ts/libmount/update +++ b/tests/ts/libmount/update @@ -23,10 +23,9 @@ TESTPROG="$TS_HELPER_LIBMOUNT_UPDATE" # Traditional /etc/mtab # export LIBMOUNT_MTAB=$TS_OUTPUT.mtab -export LIBMOUNT_FSTAB=$TS_OUTPUT.fstab +rm $LIBMOUNT_MTAB > $LIBMOUNT_MTAB -> $LIBMOUNT_FSTAB ts_init_subtest "mtab-mount" $TESTPROG --add /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec" @@ -54,4 +53,37 @@ $TESTPROG --remove /mnt/gogo cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside ts_finalize_subtest # checks the mtab +# +# utab +# +rm $LIBMOUNT_MTAB +ln -s /proc/mounts $LIBMOUNT_MTAB + +export LIBMOUNT_UTAB=$TS_OUTPUT.utab +> $LIBMOUNT_UTAB + +ts_init_subtest "utab-mount" +$TESTPROG --add /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec" +$TESTPROG --add /dev/sdb1 /mnt/bar ext3 "ro,user" +$TESTPROG --add /dev/sda2 /mnt/xyz ext3 "rw,loop=/dev/loop0,uhelper=hal" +cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside +ts_finalize_subtest # checks the mtab + +ts_init_subtest "utab-move" +$TESTPROG --move /mnt/bar /mnt/newbar +$TESTPROG --move /mnt/xyz /mnt/newxyz +cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside +ts_finalize_subtest # checks the mtab + +ts_init_subtest "utab-remount" +$TESTPROG --remount /mnt/newbar "ro,noatime" +$TESTPROG --remount /mnt/newxyz "rw,user" +cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside +ts_finalize_subtest # checks the mtab + +ts_init_subtest "utab-umount" +$TESTPROG --remove /mnt/newbar +cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside +ts_finalize_subtest # checks the mtab + ts_finalize -- 2.39.5