]> git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/libmount/update
tests: skip non-compiled libmount tests
[thirdparty/util-linux.git] / tests / ts / libmount / update
1 #!/bin/bash
2
3 # Copyright (C) 2010 Karel Zak <kzak@redhat.com>
4
5 TS_TOPDIR="$(dirname $0)/../.."
6 TS_DESC="tab update"
7
8 . $TS_TOPDIR/functions.sh
9 ts_init "$*"
10
11 TESTPROG="$TS_HELPER_LIBMOUNT_UPDATE"
12
13 [ -x $TESTPROG ] || ts_skip "test not compiled"
14
15 # IMPORTANT notes:
16 #
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.
20 #
21 # - all this test uses global $TS_OUTPUT.{mtab,mountinfo}
22
23
24 #
25 # Traditional /etc/mtab
26 #
27 export LIBMOUNT_MTAB=$TS_OUTPUT.mtab
28 rm -f $LIBMOUNT_MTAB
29 > $LIBMOUNT_MTAB
30
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
38
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
44
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
50
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
56
57 #
58 # utab
59 #
60 rm -f $LIBMOUNT_MTAB
61 ln -s /proc/mounts $LIBMOUNT_MTAB
62
63 export LIBMOUNT_UTAB=$TS_OUTPUT.utab
64 rm -f $LIBMOUNT_UTAB
65 > $LIBMOUNT_UTAB
66
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
73
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
79
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
85
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
90
91 ts_finalize