]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/libmount/update
3 # Copyright (C) 2010 Karel Zak <kzak@redhat.com>
5 TS_TOPDIR
="$(dirname $0)/../.."
8 .
$TS_TOPDIR/functions.sh
12 TESTPROG
="$TS_HELPER_LIBMOUNT_UPDATE"
14 [ -x $TESTPROG ] || ts_skip
"test not compiled"
18 # - the $TS_OUTPUT variable is between ts_init_subtest and ts_finalize_subtest
19 # redefined to subtest specific namespace -- it means that $TS_OUTPUT is a
20 # different file within a subtest.
22 # - all this test uses global $TS_OUTPUT.{mtab,mountinfo}
26 # Traditional /etc/mtab
28 export LIBMOUNT_MTAB
=$TS_OUTPUT.mtab
32 ts_init_subtest
"mtab-mount"
33 $TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
34 $TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"gg=G,ffff=f,ro,noatime"
35 $TESTPROG --add /dev
/sda2
/mnt
/bar ext3
"rw,noatime"
36 $TESTPROG --add /dev
/sda1
/mnt
/gogo ext3
"rw,noatime,nosuid"
37 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
38 ts_finalize_subtest
# checks the mtab
40 ts_init_subtest
"mtab-move"
41 $TESTPROG --move /mnt
/foo
/mnt
/newfoo
42 $TESTPROG --move /mnt
/bar
/mnt
/newbar
43 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
44 ts_finalize_subtest
# checks the mtab
46 ts_init_subtest
"mtab-remount"
47 $TESTPROG --remount /mnt
/newfoo
"ro,noatime"
48 $TESTPROG --remount /mnt
/bar
"rw,atime,nosuid"
49 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
50 ts_finalize_subtest
# checks the mtab
52 ts_init_subtest
"mtab-umount"
53 $TESTPROG --remove /mnt
/bar
54 $TESTPROG --remove /mnt
/gogo
55 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
56 ts_finalize_subtest
# checks the mtab
62 ln -s /proc
/mounts
$LIBMOUNT_MTAB
64 export LIBMOUNT_UTAB
=$TS_OUTPUT.utab
68 ts_init_subtest
"utab-mount"
69 $TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
70 $TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"ro,user"
71 $TESTPROG --add /dev
/sda2
/mnt
/xyz ext3
"rw,loop=/dev/loop0,uhelper=hal"
72 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
73 ts_finalize_subtest
# checks the mtab
75 ts_init_subtest
"utab-move"
76 $TESTPROG --move /mnt
/bar
/mnt
/newbar
77 $TESTPROG --move /mnt
/xyz
/mnt
/newxyz
78 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
79 ts_finalize_subtest
# checks the mtab
81 ts_init_subtest
"utab-remount"
82 $TESTPROG --remount /mnt
/newbar
"ro,noatime"
83 $TESTPROG --remount /mnt
/newxyz
"rw,user"
84 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
85 ts_finalize_subtest
# checks the mtab
87 ts_init_subtest
"utab-umount"
88 $TESTPROG --remove /mnt
/newbar
89 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
90 ts_finalize_subtest
# checks the mtab