]>
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
11 TESTPROG
="$TS_HELPER_LIBMOUNT_UPDATE"
13 [ -x $TESTPROG ] || ts_skip
"test not compiled"
17 # - the $TS_OUTPUT variable is between ts_init_subtest and ts_finalize_subtest
18 # redefined to subtest specific namespace -- it means that $TS_OUTPUT is a
19 # different file within a subtest.
21 # - all this test uses global $TS_OUTPUT.{mtab,mountinfo}
25 # Traditional /etc/mtab
27 export LIBMOUNT_MTAB
=$TS_OUTPUT.mtab
31 ts_init_subtest
"mtab-mount"
32 $TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
33 $TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"gg=G,ffff=f,ro,noatime"
34 $TESTPROG --add /dev
/sda2
/mnt
/bar ext3
"rw,noatime"
35 $TESTPROG --add /dev
/sda1
/mnt
/gogo ext3
"rw,noatime,nosuid"
36 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
37 ts_finalize_subtest
# checks the mtab
39 ts_init_subtest
"mtab-move"
40 $TESTPROG --move /mnt
/foo
/mnt
/newfoo
41 $TESTPROG --move /mnt
/bar
/mnt
/newbar
42 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
43 ts_finalize_subtest
# checks the mtab
45 ts_init_subtest
"mtab-remount"
46 $TESTPROG --remount /mnt
/newfoo
"ro,noatime"
47 $TESTPROG --remount /mnt
/bar
"rw,atime,nosuid"
48 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
49 ts_finalize_subtest
# checks the mtab
51 ts_init_subtest
"mtab-umount"
52 $TESTPROG --remove /mnt
/bar
53 $TESTPROG --remove /mnt
/gogo
54 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
55 ts_finalize_subtest
# checks the mtab
61 ln -s /proc
/mounts
$LIBMOUNT_MTAB
63 export LIBMOUNT_UTAB
=$TS_OUTPUT.utab
67 ts_init_subtest
"utab-mount"
68 $TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
69 $TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"ro,user"
70 $TESTPROG --add /dev
/sda2
/mnt
/xyz ext3
"rw,loop=/dev/loop0,uhelper=hal"
71 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
72 ts_finalize_subtest
# checks the mtab
74 ts_init_subtest
"utab-move"
75 $TESTPROG --move /mnt
/bar
/mnt
/newbar
76 $TESTPROG --move /mnt
/xyz
/mnt
/newxyz
77 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
78 ts_finalize_subtest
# checks the mtab
80 ts_init_subtest
"utab-remount"
81 $TESTPROG --remount /mnt
/newbar
"ro,noatime"
82 $TESTPROG --remount /mnt
/newxyz
"rw,user"
83 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
84 ts_finalize_subtest
# checks the mtab
86 ts_init_subtest
"utab-umount"
87 $TESTPROG --remove /mnt
/newbar
88 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
89 ts_finalize_subtest
# checks the mtab