]>
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}
26 # Traditional /etc/mtab
28 export LIBMOUNT_MTAB
=$TS_OUTPUT.mtab
32 ts_init_subtest
"mtab-mount"
33 ts_valgrind
$TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
34 ts_valgrind
$TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"gg=G,ffff=f,ro,noatime"
35 ts_valgrind
$TESTPROG --add /dev
/sda2
/mnt
/bar ext3
"rw,noatime"
36 ts_valgrind
$TESTPROG --add /dev
/sda1
/mnt
/gogo ext3
"rw,noatime,nosuid"
37 ts_valgrind
$TESTPROG --add none
/proc proc defaults
38 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
39 ts_finalize_subtest
# checks the mtab
41 ts_init_subtest
"mtab-move"
42 ts_valgrind
$TESTPROG --move /mnt
/foo
/mnt
/newfoo
43 ts_valgrind
$TESTPROG --move /mnt
/bar
/mnt
/newbar
44 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
45 ts_finalize_subtest
# checks the mtab
47 ts_init_subtest
"mtab-remount"
48 ts_valgrind
$TESTPROG --remount /mnt
/newfoo
"ro,noatime"
49 ts_valgrind
$TESTPROG --remount /mnt
/bar
"rw,atime,nosuid"
50 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
51 ts_finalize_subtest
# checks the mtab
53 ts_init_subtest
"mtab-umount"
54 ts_valgrind
$TESTPROG --remove /mnt
/bar
55 ts_valgrind
$TESTPROG --remove /mnt
/gogo
56 ts_valgrind
$TESTPROG --remove /proc
57 cp $LIBMOUNT_MTAB $TS_OUTPUT # save the mtab aside
58 ts_finalize_subtest
# checks the mtab
64 ln -s /proc
/mounts
$LIBMOUNT_MTAB
66 export LIBMOUNT_UTAB
=$TS_OUTPUT.utab
70 ts_init_subtest
"utab-mount"
71 ts_valgrind
$TESTPROG --add /dev
/sda1
/mnt
/foo ext3
"rw,bbb,ccc,fff=FFF,ddd,noexec"
72 ts_valgrind
$TESTPROG --add /dev
/sdb1
/mnt
/bar ext3
"ro,user"
73 ts_valgrind
$TESTPROG --add /dev
/sda2
/mnt
/xyz ext3
"rw,loop=/dev/loop0,uhelper=hal"
74 ts_valgrind
$TESTPROG --add none
/proc proc
"rw,user"
75 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
76 ts_finalize_subtest
# checks the mtab
78 ts_init_subtest
"utab-move"
79 ts_valgrind
$TESTPROG --move /mnt
/bar
/mnt
/newbar
80 ts_valgrind
$TESTPROG --move /mnt
/xyz
/mnt
/newxyz
81 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
82 ts_finalize_subtest
# checks the mtab
84 ts_init_subtest
"utab-remount"
85 ts_valgrind
$TESTPROG --remount /mnt
/newbar
"ro,noatime"
86 ts_valgrind
$TESTPROG --remount /mnt
/newxyz
"rw,user"
87 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
88 ts_finalize_subtest
# checks the mtab
90 ts_init_subtest
"utab-umount"
91 ts_valgrind
$TESTPROG --remove /mnt
/newbar
92 ts_valgrind
$TESTPROG --remove /proc
93 cp $LIBMOUNT_UTAB $TS_OUTPUT # save the mtab aside
94 ts_finalize_subtest
# checks the mtab
99 export LIBMOUNT_FSTAB
=$TS_OUTPUT.fstab
100 rm -f $LIBMOUNT_FSTAB
101 cp "$TS_SELF/files/fstab.comment" $LIBMOUNT_FSTAB
103 ts_init_subtest
"fstab-replace"
104 ts_valgrind
$TESTPROG --replace "LABEL=foo" "/mnt/foo"
105 cp $LIBMOUNT_FSTAB $TS_OUTPUT # save the fstab aside
106 ts_finalize_subtest
#checks the fstab