From: Karel Zak Date: Mon, 18 Oct 2010 13:46:12 +0000 (+0200) Subject: tests: add libmount mtab tests X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=480962c99476634490d1ef76eed4e13124423c06;p=util-linux tests: add libmount mtab tests Signed-off-by: Karel Zak --- diff --git a/tests/expected/libmount/tabfiles-find-pair b/tests/expected/libmount/tabfiles-find-pair new file mode 100644 index 00000000..4b1134cb --- /dev/null +++ b/tests/expected/libmount/tabfiles-find-pair @@ -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 index 00000000..b8ea0cfd --- /dev/null +++ b/tests/expected/libmount/tabfiles-parse-mtab @@ -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 index 00000000..2de255bd --- /dev/null +++ b/tests/ts/libmount/files/mtab @@ -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 diff --git a/tests/ts/libmount/tabfiles b/tests/ts/libmount/tabfiles index e1fbc6d6..3367fab5 100755 --- a/tests/ts/libmount/tabfiles +++ b/tests/ts/libmount/tabfiles @@ -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