]>
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
="${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}
24 export LIBMOUNT_MTAB
=$TS_OUTPUT.mtab
30 # Traditional /etc/mtab
32 has_mtab
=$
( ts_has_mtab_support
)
33 if [ "$has_mtab" == "yes" ]; then
35 ts_init_subtest
"mtab-mount"
36 ts_run
$TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
37 ts_run
$TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"gg=G,ffff=f,ro,noatime"
38 ts_run
$TESTPROG --add /dev
/sda2
/mnt
/bar ext3
"rw,noatime"
39 ts_run
$TESTPROG --add /dev
/sda1
/mnt
/gogo ext3
"rw,noatime,nosuid"
40 ts_run
$TESTPROG --add none
/proc proc defaults
41 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
42 ts_finalize_subtest
# checks the mtab
44 ts_init_subtest
"mtab-move"
45 ts_run
$TESTPROG --move /mnt
/foo
/mnt
/newfoo
46 ts_run
$TESTPROG --move /mnt
/bar
/mnt
/newbar
47 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
48 ts_finalize_subtest
# checks the mtab
50 ts_init_subtest
"mtab-remount"
51 ts_run
$TESTPROG --remount /mnt
/newfoo
"ro,noatime"
52 ts_run
$TESTPROG --remount /mnt
/bar
"rw,atime,nosuid"
53 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
54 ts_finalize_subtest
# checks the mtab
56 ts_init_subtest
"mtab-umount"
57 ts_run
$TESTPROG --remove /mnt
/bar
58 ts_run
$TESTPROG --remove /mnt
/gogo
59 ts_run
$TESTPROG --remove /proc
60 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
61 ts_finalize_subtest
# checks the mtab
68 ln -s /proc
/mounts
$LIBMOUNT_MTAB
70 export LIBMOUNT_UTAB
=$TS_OUTPUT.utab
74 ts_init_subtest
"utab-mount"
75 ts_run
$TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
76 ts_run
$TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"ro,user"
77 ts_run
$TESTPROG --add /dev
/sda2
/mnt
/xyz ext3
"rw,loop=/dev/loop0,uhelper=hal"
78 ts_run
$TESTPROG --add none
/proc proc
"rw,user"
79 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
80 ts_finalize_subtest
# checks the mtab
82 ts_init_subtest
"utab-move"
83 ts_run
$TESTPROG --move /mnt
/bar
/mnt
/newbar
84 ts_run
$TESTPROG --move /mnt
/xyz
/mnt
/newxyz
85 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
86 ts_finalize_subtest
# checks the mtab
88 ts_init_subtest
"utab-remount"
89 ts_run
$TESTPROG --remount /mnt
/newbar
"ro,noatime"
90 ts_run
$TESTPROG --remount /mnt
/newxyz
"rw,user"
91 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
92 ts_finalize_subtest
# checks the mtab
94 ts_init_subtest
"utab-umount"
95 ts_run
$TESTPROG --remove /mnt
/newbar
96 ts_run
$TESTPROG --remove /proc
97 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
98 ts_finalize_subtest
# checks the mtab
103 export LIBMOUNT_FSTAB
=$TS_OUTPUT.fstab
104 rm -f $LIBMOUNT_FSTAB
105 cp "$TS_SELF/files/fstab.comment" $LIBMOUNT_FSTAB
107 ts_init_subtest
"fstab-replace"
108 ts_run
$TESTPROG --replace "LABEL=foo" "/mnt/foo"
109 cp $LIBMOUNT_FSTAB $TS_OUTPUT # save the fstab aside
110 ts_finalize_subtest
#checks the fstab