]> err.no Git - util-linux/commitdiff
tests: add utab update tests
authorKarel Zak <kzak@redhat.com>
Mon, 8 Nov 2010 11:22:01 +0000 (12:22 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 3 Jan 2011 11:28:46 +0000 (12:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/libmount/update-utab-mount [new file with mode: 0644]
tests/expected/libmount/update-utab-move [new file with mode: 0644]
tests/expected/libmount/update-utab-remount [new file with mode: 0644]
tests/expected/libmount/update-utab-umount [new file with mode: 0644]
tests/ts/libmount/update

diff --git a/tests/expected/libmount/update-utab-mount b/tests/expected/libmount/update-utab-mount
new file mode 100644 (file)
index 0000000..0464c74
--- /dev/null
@@ -0,0 +1,2 @@
+0 0 0:0 / /mnt/bar user - ext3 /dev/sdb1 none
+0 0 0:0 / /mnt/xyz loop=/dev/loop0,uhelper=hal - ext3 /dev/sda2 none
diff --git a/tests/expected/libmount/update-utab-move b/tests/expected/libmount/update-utab-move
new file mode 100644 (file)
index 0000000..bdcf9cb
--- /dev/null
@@ -0,0 +1,2 @@
+0 0 0:0 / /mnt/newbar user - ext3 /dev/sdb1 none
+0 0 0:0 / /mnt/newxyz loop=/dev/loop0,uhelper=hal - ext3 /dev/sda2 none
diff --git a/tests/expected/libmount/update-utab-remount b/tests/expected/libmount/update-utab-remount
new file mode 100644 (file)
index 0000000..853d9fb
--- /dev/null
@@ -0,0 +1,2 @@
+0 0 0:0 / /mnt/newbar user - ext3 /dev/sdb1 none
+0 0 0:0 / /mnt/newxyz user - ext3 /dev/sda2 none
diff --git a/tests/expected/libmount/update-utab-umount b/tests/expected/libmount/update-utab-umount
new file mode 100644 (file)
index 0000000..b8c096b
--- /dev/null
@@ -0,0 +1 @@
+0 0 0:0 / /mnt/newxyz user - ext3 /dev/sda2 none
index 7de942518b012be41c694e2bb2f8e8f9eb4c1794..92c92b081ae05ba9a769a93dad79ffe594931a9c 100755 (executable)
@@ -23,10 +23,9 @@ TESTPROG="$TS_HELPER_LIBMOUNT_UPDATE"
 # Traditional /etc/mtab
 #
 export LIBMOUNT_MTAB=$TS_OUTPUT.mtab
-export LIBMOUNT_FSTAB=$TS_OUTPUT.fstab
 
+rm $LIBMOUNT_MTAB
 > $LIBMOUNT_MTAB
-> $LIBMOUNT_FSTAB
 
 ts_init_subtest "mtab-mount"
 $TESTPROG --add /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec"
@@ -54,4 +53,37 @@ $TESTPROG --remove /mnt/gogo
 cp $LIBMOUNT_MTAB $TS_OUTPUT   # save the mtab aside
 ts_finalize_subtest            # checks the mtab
 
+#
+# utab
+#
+rm $LIBMOUNT_MTAB
+ln -s /proc/mounts $LIBMOUNT_MTAB
+
+export LIBMOUNT_UTAB=$TS_OUTPUT.utab
+> $LIBMOUNT_UTAB
+
+ts_init_subtest "utab-mount"
+$TESTPROG --add /dev/sda1 /mnt/foo ext3 "rw,bbb,ccc,fff=FFF,ddd,noexec"
+$TESTPROG --add /dev/sdb1 /mnt/bar ext3 "ro,user"
+$TESTPROG --add /dev/sda2 /mnt/xyz ext3 "rw,loop=/dev/loop0,uhelper=hal"
+cp $LIBMOUNT_UTAB $TS_OUTPUT   # save the mtab aside
+ts_finalize_subtest            # checks the mtab
+
+ts_init_subtest "utab-move"
+$TESTPROG --move /mnt/bar /mnt/newbar
+$TESTPROG --move /mnt/xyz /mnt/newxyz
+cp $LIBMOUNT_UTAB $TS_OUTPUT   # save the mtab aside
+ts_finalize_subtest            # checks the mtab
+
+ts_init_subtest "utab-remount"
+$TESTPROG --remount /mnt/newbar "ro,noatime"
+$TESTPROG --remount /mnt/newxyz "rw,user"
+cp $LIBMOUNT_UTAB $TS_OUTPUT   # save the mtab aside
+ts_finalize_subtest            # checks the mtab
+
+ts_init_subtest "utab-umount"
+$TESTPROG --remove /mnt/newbar
+cp $LIBMOUNT_UTAB $TS_OUTPUT   # save the mtab aside
+ts_finalize_subtest            # checks the mtab
+
 ts_finalize