4 # Test whether quota gets properly reenabled after remount read-write
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2010 Jan Kara. All Rights Reserved.
10 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
41 # real QA test starts here
43 _supported_os Linux #IRIX
49 # real QA test starts here
52 _scratch_mkfs >> $seq.full 2>&1
53 _scratch_mount "-o usrquota,grpquota"
54 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
55 quotaon $SCRATCH_MNT 2>/dev/null
57 touch $SCRATCH_MNT/testfile
58 chown $qa_user:$qa_user $SCRATCH_MNT/testfile
60 repquota -u -g $SCRATCH_MNT | grep -v "^root" | _filter_scratch
62 # XXX This is a nasty hack. remount doesn't work on a fileystem
63 # with a context; see https://bugzilla.redhat.com/show_bug.cgi?id=563267
65 # We work around it by editing the context out of mtab. Sigh.
66 sed -i "s#^$SCRATCH_DEV\(.*\),context=\"system_u:object_r:nfs_t:s0\"#$SCRATCH_DEV\1#" /etc/mtab
67 mount -o remount,ro $SCRATCH_DEV 2>&1 | tee -a $seq.full | _filter_scratch
68 touch $SCRATCH_MNT/failed 2>&1 | tee -a $seq.full | _filter_scratch
69 mount -o remount,rw $SCRATCH_DEV 2>&1 | tee -a $seq.full | _filter_scratch
71 $XFS_IO_PROG -F -c 'pwrite 0 8k' -c 'fsync' \
72 $SCRATCH_MNT/testfile >>$seq.full 2>&1
73 repquota -u -g $SCRATCH_MNT | grep -v "^root" | _filter_scratch
75 umount $SCRATCH_DEV 2>/dev/null