forked from util-linux/util-linux
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: (findmnt) add a case testing -Q option
The mostly derrived from "filter" test case. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
- Loading branch information
Showing
12 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/proc /proc proc rw,relatime | ||
/sys /sys sysfs rw,relatime | ||
/dev udev devtmpfs rw,relatime,size=1983516k,nr_inodes=495879,mode=755 | ||
/dev/pts devpts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 | ||
/dev/shm tmpfs tmpfs rw,relatime | ||
/sys/fs/cgroup tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 | ||
/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd | ||
/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset | ||
/sys/fs/cgroup/ns cgroup cgroup rw,nosuid,nodev,noexec,relatime,ns | ||
/sys/fs/cgroup/cpu cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu | ||
/sys/fs/cgroup/cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuacct | ||
/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory | ||
/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices | ||
/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer | ||
/sys/fs/cgroup/net_cls cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls | ||
/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio | ||
/sys/kernel/security systemd-1 autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/dev/hugepages systemd-1 autofs rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/sys/kernel/debug systemd-1 autofs rw,relatime,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/dev/mqueue systemd-1 autofs rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/proc/bus/usb /proc/bus/usb usbfs rw,relatime | ||
/dev/hugepages hugetlbfs hugetlbfs rw,relatime | ||
/dev/mqueue mqueue mqueue rw,relatime | ||
/proc/sys/fs/binfmt_misc none binfmt_misc rw,relatime | ||
/sys/fs/fuse/connections fusectl fusectl rw,relatime | ||
/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 | ||
/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime | ||
/mnt/sounds //foo.home/bar/ cifs rw,relatime,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 | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/sys/kernel/security systemd-1 autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/dev/hugepages systemd-1 autofs rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/sys/kernel/debug systemd-1 autofs rw,relatime,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/dev/mqueue systemd-1 autofs rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/sys/kernel/security systemd-1 autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/dev/pts devpts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/proc /proc proc rw,relatime | ||
/sys /sys sysfs rw,relatime | ||
/dev udev devtmpfs rw,relatime,size=1983516k,nr_inodes=495879,mode=755 | ||
/dev/pts devpts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 | ||
/dev/shm tmpfs tmpfs rw,relatime | ||
/ /dev/sda4 ext3 rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered | ||
/sys/fs/cgroup tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 | ||
/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd | ||
/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset | ||
/sys/fs/cgroup/ns cgroup cgroup rw,nosuid,nodev,noexec,relatime,ns | ||
/sys/fs/cgroup/cpu cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu | ||
/sys/fs/cgroup/cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuacct | ||
/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory | ||
/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices | ||
/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer | ||
/sys/fs/cgroup/net_cls cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls | ||
/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio | ||
/dev/hugepages systemd-1 autofs rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/sys/kernel/debug systemd-1 autofs rw,relatime,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/dev/mqueue systemd-1 autofs rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/proc/bus/usb /proc/bus/usb usbfs rw,relatime | ||
/dev/hugepages hugetlbfs hugetlbfs rw,relatime | ||
/dev/mqueue mqueue mqueue rw,relatime | ||
/boot /dev/sda6 ext3 rw,noatime,errors=continue,barrier=0,data=ordered | ||
/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered | ||
/proc/sys/fs/binfmt_misc none binfmt_misc rw,relatime | ||
/sys/fs/fuse/connections fusectl fusectl rw,relatime | ||
/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 | ||
/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime | ||
/mnt/sounds //foo.home/bar/ cifs rw,relatime,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 | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/ /dev/sda4 ext3 rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered | ||
/boot /dev/sda6 ext3 rw,noatime,errors=continue,barrier=0,data=ordered | ||
/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/ /dev/sda4 ext3 rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered | ||
/boot /dev/sda6 ext3 rw,noatime,errors=continue,barrier=0,data=ordered | ||
/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/ /dev/sda4 ext3 rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered | ||
/boot /dev/sda6 ext3 rw,noatime,errors=continue,barrier=0,data=ordered | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/ /dev/sda4 ext3 rw,noatime,errors=continue,user_xattr,acl,barrier=0,data=ordered | ||
/boot /dev/sda6 ext3 rw,noatime,errors=continue,barrier=0,data=ordered | ||
/home/kzak /dev/mapper/kzak-home ext4 rw,noatime,barrier=1,data=ordered | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
TARGET SOURCE FSTYPE OPTIONS | ||
/proc /proc proc rw,relatime | ||
/sys /sys sysfs rw,relatime | ||
/dev udev devtmpfs rw,relatime,size=1983516k,nr_inodes=495879,mode=755 | ||
/dev/pts devpts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 | ||
/dev/shm tmpfs tmpfs rw,relatime | ||
/sys/fs/cgroup tmpfs tmpfs rw,nosuid,nodev,noexec,relatime,mode=755 | ||
/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd | ||
/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset | ||
/sys/fs/cgroup/ns cgroup cgroup rw,nosuid,nodev,noexec,relatime,ns | ||
/sys/fs/cgroup/cpu cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu | ||
/sys/fs/cgroup/cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuacct | ||
/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory | ||
/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices | ||
/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer | ||
/sys/fs/cgroup/net_cls cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls | ||
/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio | ||
/sys/kernel/security systemd-1 autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/dev/hugepages systemd-1 autofs rw,relatime,fd=23,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/sys/kernel/debug systemd-1 autofs rw,relatime,fd=24,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/dev/mqueue systemd-1 autofs rw,relatime,fd=26,pgrp=1,timeout=300,minproto=5,maxproto=5,direct | ||
/proc/bus/usb /proc/bus/usb usbfs rw,relatime | ||
/dev/hugepages hugetlbfs hugetlbfs rw,relatime | ||
/dev/mqueue mqueue mqueue rw,relatime | ||
/proc/sys/fs/binfmt_misc none binfmt_misc rw,relatime | ||
/sys/fs/fuse/connections fusectl fusectl rw,relatime | ||
/home/kzak/.gvfs gvfs-fuse-daemon fuse.gvfs-fuse-daemon rw,nosuid,nodev,relatime,user_id=500,group_id=500 | ||
/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime | ||
/mnt/sounds //foo.home/bar/ cifs rw,relatime,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 | ||
rc=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/bash | ||
|
||
# This file is part of util-linux. | ||
# | ||
# This file is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This file is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
TS_TOPDIR="${0%/*}/../.." | ||
TS_DESC="filterQ" | ||
|
||
. "$TS_TOPDIR"/functions.sh | ||
ts_init "$*" | ||
|
||
ts_check_test_command "$TS_CMD_FINDMNT" | ||
|
||
ts_init_subtest "types" | ||
$TS_CMD_FINDMNT -Q 'FSTYPE == "ext3"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "types-multi" | ||
$TS_CMD_FINDMNT -Q 'FSTYPE =~ "ext[34]"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "types-neg" | ||
$TS_CMD_FINDMNT -Q 'FSTYPE !~ "ext[34]"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS =~ "\<relatime\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options-name" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS =~ "\<fd\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options-nameval" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS =~ "\<fd=22\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options-nameval-neg" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS !~ "\<fd=22\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options-nameval-multi" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS =~ "\<ptmxmode=000\>" && OPTIONS =~ "\<mode=620\>" && OPTIONS =~ "\<gid=5\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options-neg" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS !~ "\<relatime\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options-no" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS =~ "\<noatime\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
ts_finalize_subtest | ||
|
||
ts_init_subtest "options-no-multi" | ||
$TS_CMD_FINDMNT -Q 'OPTIONS =~ "\<nosuid\>" && OPTIONS =~ "\<nodev\>" && OPTIONS =~ "\<blkio\>"' --kernel --tab-file "$TS_SELF/files/mountinfo" &> $TS_OUTPUT | ||
echo rc=$? >> $TS_OUTPUT | ||
|
||
ts_finalize |