]> err.no Git - util-linux/commitdiff
tests: add libmount mtab tests
authorKarel Zak <kzak@redhat.com>
Mon, 18 Oct 2010 13:46:12 +0000 (15:46 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 3 Jan 2011 11:28:45 +0000 (12:28 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/libmount/tabfiles-find-pair [new file with mode: 0644]
tests/expected/libmount/tabfiles-parse-mtab [new file with mode: 0644]
tests/ts/libmount/files/mtab [new file with mode: 0644]
tests/ts/libmount/tabfiles

diff --git a/tests/expected/libmount/tabfiles-find-pair b/tests/expected/libmount/tabfiles-find-pair
new file mode 100644 (file)
index 0000000..4b1134c
--- /dev/null
@@ -0,0 +1,5 @@
+------ fs:
+source: /dev/mapper/kzak-home
+target: /home/kzak
+fstype: ext4
+optstr: rw,noatime
diff --git a/tests/expected/libmount/tabfiles-parse-mtab b/tests/expected/libmount/tabfiles-parse-mtab
new file mode 100644 (file)
index 0000000..b8ea0cf
--- /dev/null
@@ -0,0 +1,55 @@
+------ fs:
+source: /dev/sda4
+target: /
+fstype: ext3
+optstr: rw,noatime
+------ fs:
+source: proc
+target: /proc
+fstype: proc
+optstr: rw
+------ fs:
+source: sysfs
+target: /sys
+fstype: sysfs
+optstr: rw
+------ fs:
+source: devpts
+target: /dev/pts
+fstype: devpts
+optstr: rw,gid=5,mode=620
+------ fs:
+source: tmpfs
+target: /dev/shm
+fstype: tmpfs
+optstr: rw
+------ fs:
+source: /dev/sda6
+target: /boot
+fstype: ext3
+optstr: rw,noatime
+------ fs:
+source: /dev/mapper/kzak-home
+target: /home/kzak
+fstype: ext4
+optstr: rw,noatime
+------ fs:
+source: (null)
+target: /proc/sys/fs/binfmt_misc
+fstype: binfmt_misc
+optstr: rw
+------ fs:
+source: fusectl
+target: /sys/fs/fuse/connections
+fstype: fusectl
+optstr: rw
+------ fs:
+source: gvfs-fuse-daemon
+target: /home/kzak/.gvfs
+fstype: fuse.gvfs-fuse-daemon
+optstr: rw,nosuid,nodev,user=kzak
+------ fs:
+source: sunrpc
+target: /var/lib/nfs/rpc_pipefs
+fstype: rpc_pipefs
+optstr: rw
diff --git a/tests/ts/libmount/files/mtab b/tests/ts/libmount/files/mtab
new file mode 100644 (file)
index 0000000..2de255b
--- /dev/null
@@ -0,0 +1,11 @@
+/dev/sda4 / ext3 rw,noatime 0 0
+proc /proc proc rw 0 0
+sysfs /sys sysfs rw 0 0
+devpts /dev/pts devpts rw,gid=5,mode=620 0 0
+tmpfs /dev/shm tmpfs rw 0 0
+/dev/sda6 /boot ext3 rw,noatime 0 0
+/dev/mapper/kzak-home /home/kzak ext4 rw,noatime 0 0
+none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
+fusectl /sys/fs/fuse/connections fusectl rw 0 0
+gvfs-fuse-daemon /home/kzak/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=kzak 0 0
+sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
index e1fbc6d68f33c42443630cb22211fcffb4121ca5..3367fab5bbd90bea01df88d674510ef63b0a40bd 100755 (executable)
@@ -15,6 +15,11 @@ $TESTPROG --parse "$TS_SELF/files/fstab" &> $TS_OUTPUT
 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
 ts_finalize_subtest
 
+ts_init_subtest "parse-mtab"
+$TESTPROG --parse "$TS_SELF/files/mtab" &> $TS_OUTPUT
+sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
+ts_finalize_subtest
+
 ts_init_subtest "parse-fstab-broken"
 $TESTPROG --parse "$TS_SELF/files/fstab.broken" &> $TS_OUTPUT
 sed -i -e 's/.*fstab.broken:[[:digit:]]*: parse error//g; s/fs: 0x.*/fs:/g' $TS_OUTPUT
@@ -40,4 +45,9 @@ $TESTPROG --find-forward "$TS_SELF/files/fstab" target /home/foo &> $TS_OUTPUT
 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
 ts_finalize_subtest
 
+ts_init_subtest "find-pair"
+$TESTPROG --find-pair "$TS_SELF/files/mtab" /dev/mapper/kzak-home /home/kzak &> $TS_OUTPUT
+sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
+ts_finalize_subtest
+
 ts_finalize