diff options
Diffstat (limited to 'tests/ts')
-rw-r--r-- | tests/ts/libmount/files/fstab | 12 | ||||
-rw-r--r-- | tests/ts/libmount/files/fstab.broken | 14 | ||||
-rw-r--r-- | tests/ts/libmount/files/mountinfo | 32 | ||||
-rwxr-xr-x | tests/ts/libmount/tabfiles | 43 |
4 files changed, 101 insertions, 0 deletions
diff --git a/tests/ts/libmount/files/fstab b/tests/ts/libmount/files/fstab new file mode 100644 index 00000000..2503065e --- /dev/null +++ b/tests/ts/libmount/files/fstab @@ -0,0 +1,12 @@ +UUID=d3a8f783-df75-4dc8-9163-975a891052c0 / ext3 noatime,defaults 1 1 +UUID=fef7ccb3-821c-4de8-88dc-71472be5946f /boot ext3 noatime,defaults 1 2 +UUID=1f2aa318-9c34-462e-8d29-260819ffd657 swap swap defaults 0 0 +tmpfs /dev/shm tmpfs defaults 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +sysfs /sys sysfs defaults 0 0 +proc /proc proc defaults 0 0 +# this is comment +/dev/mapper/foo /home/foo ext4 noatime,defaults 0 0 + +foo.com:/mnt/share /mnt/remote nfs noauto +//bar.com/gogogo /mnt/gogogo cifs user=SRGROUP/baby,noauto diff --git a/tests/ts/libmount/files/fstab.broken b/tests/ts/libmount/files/fstab.broken new file mode 100644 index 00000000..c79f026e --- /dev/null +++ b/tests/ts/libmount/files/fstab.broken @@ -0,0 +1,14 @@ +bug +UUID=d3a8f783-df75-4dc8-9163-975a891052c0 / ext3 noatime,defaults 1 1 +UUID=fef7ccb3-821c-4de8-88dc-71472be5946f /boot ext3 noatime,defaults 1 2 + UUID=1f2aa318-9c34-462e-8d29-260819ffd657 swap swap defaults 0 0 +tmpfs /dev/shm tmpfs defaults 0 0 +devpts /dev/pts devpts gid=5,mode=620 + sysfs /sys sysfs defaults 0 0 +this is broken line with unexpected number of fields +proc /proc proc defaults 0 0 +# this is comment +/dev/mapper/foo /home/foo ext4 noatime,defaults 1 + +foo.com:/mnt/share /mnt/remote nfs noauto +//bar.com/gogogo /mnt/gogogo cifs user=SRGROUP/baby,noauto diff --git a/tests/ts/libmount/files/mountinfo b/tests/ts/libmount/files/mountinfo new file mode 100644 index 00000000..ff1e664a --- /dev/null +++ b/tests/ts/libmount/files/mountinfo @@ -0,0 +1,32 @@ +15 20 0:3 / /proc rw,relatime - proc /proc rw +16 20 0:15 / /sys rw,relatime - sysfs /sys rw +17 20 0:5 / /dev rw,relatime - devtmpfs udev rw,size=1983516k,nr_inodes=495879,mode=755 +18 17 0:10 / /dev/pts rw,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000 +19 17 0:16 / /dev/shm rw,relatime - tmpfs tmpfs rw +20 1 8:4 / / rw,noatime - ext3 /dev/sda4 rw,errors=continue,user_xattr,acl,barrier=0,data=ordered +21 16 0:17 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - tmpfs tmpfs rw,mode=755 +22 21 0:18 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd +23 21 0:19 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpuset +24 21 0:20 / /sys/fs/cgroup/ns rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,ns +25 21 0:21 / /sys/fs/cgroup/cpu rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpu +26 21 0:22 / /sys/fs/cgroup/cpuacct rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,cpuacct +27 21 0:23 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,memory +28 21 0:24 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,devices +29 21 0:25 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,freezer +30 21 0:26 / /sys/fs/cgroup/net_cls rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,net_cls +31 21 0:27 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime - cgroup cgroup rw,blkio +32 16 0:28 / /sys/kernel/security rw,relatime - autofs systemd-1 rw,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct +33 17 0:29 / /dev/hugepages rw,relatime - autofs systemd-1 rw,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct +34 16 0:30 / /sys/kernel/debug rw,relatime - autofs systemd-1 rw,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct +35 15 0:31 / /proc/sys/fs/binfmt_misc rw,relatime - autofs systemd-1 rw,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct +36 17 0:32 / /dev/mqueue rw,relatime - autofs systemd-1 rw,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct +37 15 0:14 / /proc/bus/usb rw,relatime - usbfs /proc/bus/usb rw +38 33 0:33 / /dev/hugepages rw,relatime - hugetlbfs hugetlbfs rw +39 36 0:12 / /dev/mqueue rw,relatime - mqueue mqueue rw +40 20 8:6 / /boot rw,noatime - ext3 /dev/sda6 rw,errors=continue,barrier=0,data=ordered +41 20 253:0 / /home/kzak rw,noatime - ext4 /dev/mapper/kzak-home rw,barrier=1,data=ordered +42 35 0:34 / /proc/sys/fs/binfmt_misc rw,relatime - binfmt_misc none rw +43 16 0:35 / /sys/fs/fuse/connections rw,relatime - fusectl fusectl rw +44 41 0:36 / /home/kzak/.gvfs rw,nosuid,nodev,relatime - fuse.gvfs-fuse-daemon gvfs-fuse-daemon rw,user_id=500,group_id=500 +45 20 0:37 / /var/lib/nfs/rpc_pipefs rw,relatime - rpc_pipefs sunrpc rw +47 20 0:38 / /mnt/sounds rw,relatime - cifs //foo.home/bar/ rw,unc=\\foo.home\bar,username=kzak,domain=SRGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.111.1,posixpaths,serverino,acl,rsize=16384,wsize=57344 diff --git a/tests/ts/libmount/tabfiles b/tests/ts/libmount/tabfiles new file mode 100755 index 00000000..e1fbc6d6 --- /dev/null +++ b/tests/ts/libmount/tabfiles @@ -0,0 +1,43 @@ +#!/bin/bash + +# Copyright (C) 2010 Karel Zak <kzak@redhat.com> + +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="tab files" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +TESTPROG="$TS_HELPER_TABFILES" + +ts_init_subtest "parse-fstab" +$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-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 +ts_finalize_subtest + +ts_init_subtest "parse-mountinfo" +$TESTPROG --parse "$TS_SELF/files/mountinfo" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "copy" +$TESTPROG --copy-fs "$TS_SELF/files/fstab" &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "find-source" +$TESTPROG --find-forward "$TS_SELF/files/fstab" source UUID=fef7ccb3-821c-4de8-88dc-71472be5946f &> $TS_OUTPUT +sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT +ts_finalize_subtest + +ts_init_subtest "find-target" +$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_finalize |