summaryrefslogtreecommitdiff
path: root/tests/ts/libmount/update
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2010-10-21 09:00:50 +0200
committerKarel Zak <kzak@redhat.com>2011-01-03 12:28:46 +0100
commit418187ce9644bcb996ef160444f7d7dc72b5eee0 (patch)
tree87ba3ea05d696f3fe3bf12dded2860449b9ad338 /tests/ts/libmount/update
parent3a5b1b1d5d8cae6e7c4ee4f33f2fc20be3ddf6f4 (diff)
downloadutil-linux-old-418187ce9644bcb996ef160444f7d7dc72b5eee0.tar.gz
tests: add libmount mtab update test
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/ts/libmount/update')
-rwxr-xr-xtests/ts/libmount/update64
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/ts/libmount/update b/tests/ts/libmount/update
new file mode 100755
index 00000000..c3d26e3e
--- /dev/null
+++ b/tests/ts/libmount/update
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Copyright (C) 2010 Karel Zak <kzak@redhat.com>
+
+TS_TOPDIR="$(dirname $0)/../.."
+TS_DESC="tab update"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+TESTPROG="$TS_HELPER_LIBMOUNT_UPDATE"
+
+# IMPORTANT notes:
+#
+# - the $TS_OUTPUT variable is between ts_init_subtest and ts_finalize_subtest
+# redefined to subtest specific namespace -- it means that $TS_OUTPUT is a
+# different file within a subtest.
+#
+# - all this test uses global $TS_OUTPUT.{mtab,mountinfo}
+
+
+#
+# Traditional /etc/mtab
+#
+export LIBMOUNT_MTAB=$TS_OUTPUT.mtab
+export LIBMOUNT_FSTAB=$TS_OUTPUT.fstab
+
+> $LIBMOUNT_MTAB
+> $LIBMOUNT_FSTAB
+
+ts_init_subtest "mtab-mount"
+$TESTPROG --add /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec"
+$TESTPROG --add /dev/sdb1 /mnt/bar ext3 "gg=G,ffff=f,ro,noatime"
+$TESTPROG --add /dev/sda2 /mnt/bar ext3 "rw,noatime"
+$TESTPROG --add /dev/sda1 /mnt/gogo ext3 "rw,noatime,nosuid"
+cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
+ts_finalize_subtest # checks the mtab
+
+ts_init_subtest "mtab-move"
+$TESTPROG --move /mnt/foo /mnt/newfoo
+$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"
+$TESTPROG --remount /mnt/newfoo "ro,noatime"
+$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"
+$TESTPROG --remove /mnt/bar
+$TESTPROG --remove /mnt/gogo
+cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
+ts_finalize_subtest # checks the mtab
+
+ts_init_subtest "fstab-add"
+$TESTPROG --add-fstab /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec" 1 2
+$TESTPROG --add-fstab /dev/sda2 /mnt/bar auto "defaults" 1 2
+$TESTPROG --add-fstab /dev/sda3 /mnt/bar auto "rw,context=\"some,selinux,junk\",noatime" 1 2
+cp $LIBMOUNT_FSTAB $TS_OUTPUT # save the fstab aside
+ts_finalize_subtest # checks the fstab
+
+ts_finalize