4 # This test exercises an issue in libxcmd where a problem with any
5 # mount point or project quota directory causes the program to exit
6 # complete. The effect of this is that one cannot operate on any
7 # directory, even if the problem directory is completely unrelated
8 # to the directory one wants to operate on.
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2011 SGI. All Rights Reserved.
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
31 echo "QA output created by ${seq}"
38 mtab=/proc/self/mounts
40 status=1 # failure is the default!
41 trap "_cleanup; exit \$status" 0 1 2 3 15
49 # get standard environment, filters and checks
54 echo "Silence is golden."
56 # real QA test starts here
58 # Modify as appropriate.
65 # Just use the current mount table as an example mtab file. Odds
66 # are good there's nothing wrong with it.
68 cp "${mtab}" "${my_mtab}"
71 # Any bogus entry in the mtab file is enough to trigger the problem.
72 # So just append a bogus entry at the end of the private mtab file.
73 # This matches an actually-observed entry in a mount table (with a
74 # few characters in the paths changed to protect the innocent).
76 cat <<-! >> "${my_mtab}"
77 /dev/disk/by-id/scsi-3600508e000000000c329ba1d8b0c391b-part3 /tmp/autoY8qcJ9\040(deleted) xfs rw 0 0
83 export MOUNT_OPTIONS=""
84 elif [ $# -eq 1 ]; then
85 [ $1 = u -o $1 = g -o $1 = p ] || exit
86 export MOUNT_OPTIONS="-o${1}quota"
93 # Set up a private mount table file, then try out a simple quota
94 # command to show mounts
96 echo print | xfs_quota -t "${my_mtab}" > /dev/null || exit
98 # Do the same simple quota command after adding a bogus entry to the
99 # mount table. Old code will bail on this because it has trouble
100 # with the bogus entry.
102 echo print | xfs_quota -t "${my_mtab}" > /dev/null || exit
107 # Mount SCRATCH with no quota options
113 # group quota enabled
119 status=0 # success, all done