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 #-----------------------------------------------------------------------
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by ${seq}"
37 mtab=/proc/self/mounts
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
48 # get standard environment, filters and checks
53 echo "Silence is golden."
55 # real QA test starts here
57 # Modify as appropriate.
64 # Just use the current mount table as an example mtab file. Odds
65 # are good there's nothing wrong with it.
67 cp "${mtab}" "${my_mtab}"
70 # Any bogus entry in the mtab file is enough to trigger the problem.
71 # So just append a bogus entry at the end of the private mtab file.
72 # This matches an actually-observed entry in a mount table (with a
73 # few characters in the paths changed to protect the innocent).
75 cat <<-! >> "${my_mtab}"
76 /dev/disk/by-id/scsi-3600508e000000000c329ba1d8b0c391b-part3 /tmp/autoY8qcJ9\040(deleted) xfs rw 0 0
82 export MOUNT_OPTIONS=""
83 elif [ $# -eq 1 ]; then
84 [ $1 = u -o $1 = g -o $1 = p ] || exit
85 export MOUNT_OPTIONS="-o${1}quota"
92 # Set up a private mount table file, then try out a simple quota
93 # command to show mounts
95 echo print | xfs_quota -t "${my_mtab}" > /dev/null || exit
97 # Do the same simple quota command after adding a bogus entry to the
98 # mount table. Old code will bail on this because it has trouble
99 # with the bogus entry.
101 echo print | xfs_quota -t "${my_mtab}" > /dev/null || exit
106 # Mount SCRATCH with no quota options
112 # group quota enabled
118 status=0 # success, all done