* Quota tests for XFSQA
@ 2010-05-18 23:36 Jan Kara
2010-05-18 23:36 ` [PATCH 1/3] Test basic quota enforcement Jan Kara
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jan Kara @ 2010-05-18 23:36 UTC (permalink / raw)
To: xfs; +Cc: hch
Hi,
in this series are three tests I have written (basically gathered from
various scripts) for XFSQA. The test quota accounting and also limits
basic enforcement for VFS quotas (i.e. mainly ext? filesystems). Could
the tests be included?
I'd like to add two more tests (fsstress running under 'nobody' with quota
limits tightly set so that we get often EDQUOT failures) and a test where
setquota would be stressing addition and removal of quota structures.
Hopefully I'll get to it later this week.
Honza
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] Test basic quota enforcement
2010-05-18 23:36 Quota tests for XFSQA Jan Kara
@ 2010-05-18 23:36 ` Jan Kara
2010-05-19 0:55 ` Dave Chinner
2010-05-18 23:36 ` [PATCH 2/3] Add test of quota accounting using fsx Jan Kara
2010-05-18 23:36 ` [PATCH 3/3] Add quota test with fsstress Jan Kara
2 siblings, 1 reply; 5+ messages in thread
From: Jan Kara @ 2010-05-18 23:36 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Add a test which checks whether basic quota enforcement works.
Signed-off-by: Jan Kara <jack@suse.cz>
---
230 | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
230.out | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
group | 1 +
3 files changed, 281 insertions(+), 0 deletions(-)
create mode 100755 230
create mode 100644 230.out
diff --git a/230 b/230
new file mode 100755
index 0000000..e4ef657
--- /dev/null
+++ b/230
@@ -0,0 +1,149 @@
+#! /bin/bash
+# FS QA Test No. 230
+#
+# Simple quota enforcement test.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2010 Jan Kara. All Rights Reserved.
+#
+# Based on test 219,
+# Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program 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.
+#
+# This program is distributed in the hope that it would 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux #IRIX
+_require_scratch
+_require_quota
+
+test_files()
+{
+ echo; echo "### create files, setting up ownership (type=$type)"
+ rm -f $SCRATCH_MNT/file{1,2,3,4}
+ touch $SCRATCH_MNT/file{1,2}
+ chown $user $SCRATCH_MNT/file{1,2}
+ chgrp $group $SCRATCH_MNT/file{1,2}
+ chmod 777 $SCRATCH_MNT
+}
+
+test_enforcement()
+{
+ echo "### some buffered IO (type=$type)"
+ echo "--- initiating IO..." >>$seq.full
+ # Firstly fit below block soft limit
+ sudo -u $user $XFS_IO_PROG -F -c 'pwrite 0 4096' -c 'fsync' \
+ $SCRATCH_MNT/file1 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ # Secondly overcome block soft limit
+ sudo -u $user $XFS_IO_PROG -F -c 'pwrite 0 4097' -c 'fsync' \
+ $SCRATCH_MNT/file1 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ # Now try to overcome block hardlimit
+ sudo -u $user $XFS_IO_PROG -F -c 'pwrite 0 4097' -c 'fsync' \
+ $SCRATCH_MNT/file2 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ # Now sleep for grace time and check that softlimit got enforced
+ sleep $grace
+ sudo -u $user $XFS_IO_PROG -F -c 'truncate 0' -c 'pwrite 0 1' \
+ $SCRATCH_MNT/file2 2>&1 >>$seq.full | tee -a $seq.full
+ repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ # And now the softlimit test for inodes
+ sudo -u $user touch $SCRATCH_MNT/file3 2>&1 >>$seq.full |
+ tee -a $seq.full
+ repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ # Try to exceed inode hardlimit
+ sudo -u $user touch $SCRATCH_MNT/file4 $SCRATCH_MNT/file5 2>&1 \
+ >>$seq.full | tee -a $seq.full
+ repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ # Wait and check grace time enforcement
+ rm -f $SCRATCH_MNT/file4 >>$seq.full 2>&1
+ sleep $grace
+ sudo -u $user touch $SCRATCH_MNT/file4 2>&1 >>$seq.full |
+ tee -a $seq.full
+ repquota -$type -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }'
+ echo "--- completed IO ($type)" >>$seq.full
+}
+
+# real QA test starts here
+rm -f $seq.full
+
+user=nobody
+group=`sudo -u $user id -g`
+grace=2
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon $SCRATCH_MNT 2>/dev/null
+setquota -u $user 4 12 2 4 $SCRATCH_MNT
+setquota -u -t $grace $grace $SCRATCH_MNT
+setquota -g $group 4 12 2 4 $SCRATCH_MNT
+setquota -g -t $grace $grace $SCRATCH_MNT
+umount $SCRATCH_DEV
+
+echo; echo "### test user limit enforcement"
+export MOUNT_OPTIONS="-o usrquota"
+_qmount
+quotaon $SCRATCH_MNT 2>/dev/null
+type=u
+test_files
+test_enforcement
+umount $SCRATCH_DEV 2>/dev/null
+
+echo; echo "### test group limit enforcement"
+export MOUNT_OPTIONS="-o grpquota"
+_qmount
+quotaon $SCRATCH_MNT 2>/dev/null
+type=g
+test_files
+test_enforcement
+umount $SCRATCH_DEV 2>/dev/null
+
+status=0
+exit
diff --git a/230.out b/230.out
new file mode 100644
index 0000000..ee1b5ec
--- /dev/null
+++ b/230.out
@@ -0,0 +1,131 @@
+QA output created by 230
+
+### test user limit enforcement
+
+### create files, setting up ownership (type=u)
+### some buffered IO (type=u)
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65534 -- 4 4 12 2 2 4
+
+
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65534 +- 8 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65534 +- 12 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65534 +- 8 4 12 none 2 2 4
+
+
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65534 ++ 8 4 12 none 3 2 4 00:00
+
+
+touch: cannot touch `/local/test1/file5': Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65534 ++ 8 4 12 none 4 2 4 00:00
+
+
+touch: cannot touch `/local/test1/file4': Disk quota exceeded
+*** Report for user quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+User used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65534 ++ 8 4 12 none 3 2 4 none
+
+
+
+### test group limit enforcement
+
+### create files, setting up ownership (type=g)
+### some buffered IO (type=g)
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65533 -- 4 4 12 2 2 4
+
+
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65533 +- 8 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65533 +- 12 4 12 00:00 2 2 4
+
+
+pwrite64: Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65533 +- 8 4 12 none 2 2 4
+
+
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65533 ++ 8 4 12 none 3 2 4 00:00
+
+
+touch: cannot touch `/local/test1/file5': Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65533 ++ 8 4 12 none 4 2 4 00:00
+
+
+touch: cannot touch `/local/test1/file4': Disk quota exceeded
+*** Report for group quotas on device [SCR_DEV]
+Block grace time: 00:00; Inode grace time: 00:00
+ Block limits File limits
+Group used soft hard grace used soft hard grace
+----------------------------------------------------------------------
+#65533 ++ 8 4 12 none 3 2 4 none
+
+
diff --git a/group b/group
index 2c1ac50..441e0e9 100644
--- a/group
+++ b/group
@@ -343,3 +343,4 @@ deprecated
227 auto fsr
228 rw auto prealloc quick
229 auto rw
+230 auto quota quick
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] Add test of quota accounting using fsx
2010-05-18 23:36 Quota tests for XFSQA Jan Kara
2010-05-18 23:36 ` [PATCH 1/3] Test basic quota enforcement Jan Kara
@ 2010-05-18 23:36 ` Jan Kara
2010-05-18 23:36 ` [PATCH 3/3] Add quota test with fsstress Jan Kara
2 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2010-05-18 23:36 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Run fsx (and also several fsx threads in parallel) and verify that
quota accounting is correct after they finish.
Signed-off-by: Jan Kara <jack@suse.cz>
---
231 | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
231.out | 10 +++++
group | 1 +
3 files changed, 149 insertions(+), 0 deletions(-)
create mode 100755 231
create mode 100644 231.out
diff --git a/231 b/231
new file mode 100755
index 0000000..fd4dac2
--- /dev/null
+++ b/231
@@ -0,0 +1,138 @@
+#! /bin/bash
+# FSQA Test No. 231
+#
+# Run fsx with quotas enabled and verify accounted quotas in the end
+#
+# Derived from test 127
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program 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.
+#
+# This program is distributed in the hope that it would 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+FSX_FILE_SIZE=64000000
+FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+check_usage()
+{
+ quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }' >$tmp.orig
+ quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }' >$tmp.checked
+ quotaon -u -g $SCRATCH_MNT 2>/dev/null
+ diff $tmp.orig $tmp.checked
+}
+
+_fsx()
+{
+ tasks=$1
+ echo "=== FSX Standard Mode, Memory Mapping, $tasks Tasks ==="
+ for (( i = 1; i <= $tasks; i++ )); do
+ sudo -u nobody ltp/fsx $FSX_ARGS $SCRATCH_MNT/fsx_file$i \
+ >$tmp.output$i 2>&1 &
+ done
+
+ for (( i = 1; i <= $tasks; i++ )); do
+ if ! wait %$i; then
+ cat $tmp.output$i
+ wait
+ return 1
+ fi
+ $XFS_IO_PROG -F -c 'fsync' $SCRATCH_MNT/fsx_file$i
+ cat $tmp.output$i
+ done
+ return 0
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+chmod 777 $SCRATCH_MNT
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+
+if ! _fsx 1; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! _fsx 4; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+#flush cache after write
+FSX_ARGS="-f $FSX_ARGS"
+if ! _fsx 1; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+umount $SCRATCH_DEV 2>/dev/null
+status=0
+exit
diff --git a/231.out b/231.out
new file mode 100644
index 0000000..2f2d072
--- /dev/null
+++ b/231.out
@@ -0,0 +1,10 @@
+QA output created by 231
+=== FSX Standard Mode, Memory Mapping, 1 Tasks ===
+All operations completed A-OK!
+=== FSX Standard Mode, Memory Mapping, 4 Tasks ===
+All operations completed A-OK!
+All operations completed A-OK!
+All operations completed A-OK!
+All operations completed A-OK!
+=== FSX Standard Mode, Memory Mapping, 1 Tasks ===
+All operations completed A-OK!
diff --git a/group b/group
index 441e0e9..6b59c69 100644
--- a/group
+++ b/group
@@ -344,3 +344,4 @@ deprecated
228 rw auto prealloc quick
229 auto rw
230 auto quota quick
+231 auto quota
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] Add quota test with fsstress
2010-05-18 23:36 Quota tests for XFSQA Jan Kara
2010-05-18 23:36 ` [PATCH 1/3] Test basic quota enforcement Jan Kara
2010-05-18 23:36 ` [PATCH 2/3] Add test of quota accounting using fsx Jan Kara
@ 2010-05-18 23:36 ` Jan Kara
2 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2010-05-18 23:36 UTC (permalink / raw)
To: xfs; +Cc: hch, Jan Kara
Run fsstress and verify that quota accounting is correct after it finishes.
Signed-off-by: Jan Kara <jack@suse.cz>
---
232 | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
232.out | 6 +++
group | 1 +
3 files changed, 124 insertions(+), 0 deletions(-)
create mode 100755 232
create mode 100644 232.out
diff --git a/232 b/232
new file mode 100755
index 0000000..064f07b
--- /dev/null
+++ b/232
@@ -0,0 +1,117 @@
+#! /bin/bash
+# FSQA Test No. 232
+#
+# Run fsstress with quotas enabled and verify accounted quotas in the end
+#
+# Derived from test 231
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program 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.
+#
+# This program is distributed in the hope that it would 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#-----------------------------------------------------------------------
+#
+# creator
+owner=jack@suse.cz
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.quota
+
+FSX_FILE_SIZE=64000000
+FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
+
+filter_scratch()
+{
+ perl -ne "
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+ print;"
+}
+
+check_usage()
+{
+ quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }' | sort >$tmp.orig
+ quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+ repquota -u -g -n $SCRATCH_MNT | grep -v "^#0" | filter_scratch |
+ awk '/^#/ { if (seen[$1]) next; seen[$1]++; } { print; }' | sort >$tmp.checked
+ quotaon -u -g $SCRATCH_MNT 2>/dev/null
+ diff $tmp.orig $tmp.checked
+}
+
+_filter_num()
+{
+ tee -a $here/$seq.full |\
+ sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
+ -e 's/[0-9][0-9]* paths/P paths/g' \
+ -e 's/seed = [0-9][0-9]*/seed = S/'
+}
+
+_fsstress()
+{
+ echo ""
+ echo "Testing fsstress"
+ echo ""
+
+ out=$SCRATCH_MNT/fsstress.$$
+ count=2000
+ args="-n $count -d $out -p 7"
+
+ echo "fsstress $args" | sed -e "s#$out#outdir#"
+ if ! $FSSTRESS_PROG $args | _filter_num
+ then
+ echo " fsstress $args returned $?"
+ cat $tmp.out | tee -a $here/$seq.full
+ status=1
+ fi
+}
+
+# real QA test starts here
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+_require_quota
+
+umount $SCRATCH_DEV 2>/dev/null
+_scratch_mkfs >> $seq.full 2>&1
+_scratch_mount "-o usrquota,grpquota"
+chmod 777 $SCRATCH_MNT
+quotacheck -u -g $SCRATCH_MNT 2>/dev/null
+quotaon -u -g $SCRATCH_MNT 2>/dev/null
+
+if ! _fsstress; then
+ umount $SCRATCH_DEV 2>/dev/null
+ exit
+fi
+
+if ! check_usage; then
+ umount $SCRATCH_DEV 2>/dev/null
+ status=1
+ exit
+fi
+
+umount $SCRATCH_DEV 2>/dev/null
+status=0
+exit
diff --git a/232.out b/232.out
new file mode 100644
index 0000000..744192e
--- /dev/null
+++ b/232.out
@@ -0,0 +1,6 @@
+QA output created by 232
+
+Testing fsstress
+
+fsstress -n 2000 -d outdir -p 7
+seed = S
diff --git a/group b/group
index 6b59c69..c8cd774 100644
--- a/group
+++ b/group
@@ -345,3 +345,4 @@ deprecated
229 auto rw
230 auto quota quick
231 auto quota
+232 auto quota
--
1.6.4.2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] Test basic quota enforcement
2010-05-18 23:36 ` [PATCH 1/3] Test basic quota enforcement Jan Kara
@ 2010-05-19 0:55 ` Dave Chinner
0 siblings, 0 replies; 5+ messages in thread
From: Dave Chinner @ 2010-05-19 0:55 UTC (permalink / raw)
To: Jan Kara; +Cc: hch, xfs
On Wed, May 19, 2010 at 01:36:14AM +0200, Jan Kara wrote:
> Add a test which checks whether basic quota enforcement works.
Couple of quick things:
- we have ${qa_user} for running stuff under a specific user
- sudo is not installed or configured for this sort of usage
on many systems - typically su is used instead (e.g. see
test 193)
> +# real QA test starts here
> +rm -f $seq.full
> +
> +user=nobody
> +group=`sudo -u $user id -g`
> +grace=2
> +
> +umount $SCRATCH_DEV 2>/dev/null
The scratch device should already be unmounted. if it isn't something
went wrong in a previous test and unmounting it here isn't going to
help.
> +_scratch_mkfs >> $seq.full 2>&1
> +_scratch_mount "-o usrquota,grpquota"
> +quotacheck -u -g $SCRATCH_MNT 2>/dev/null
> +quotaon $SCRATCH_MNT 2>/dev/null
> +setquota -u $user 4 12 2 4 $SCRATCH_MNT
> +setquota -u -t $grace $grace $SCRATCH_MNT
> +setquota -g $group 4 12 2 4 $SCRATCH_MNT
> +setquota -g -t $grace $grace $SCRATCH_MNT
> +umount $SCRATCH_DEV
> +
> +echo; echo "### test user limit enforcement"
> +export MOUNT_OPTIONS="-o usrquota"
> +_qmount
That will overwrite any mount options specified on the command line.
perhaps better is to use:
scratch_mount -o usrquota
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-19 0:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18 23:36 Quota tests for XFSQA Jan Kara
2010-05-18 23:36 ` [PATCH 1/3] Test basic quota enforcement Jan Kara
2010-05-19 0:55 ` Dave Chinner
2010-05-18 23:36 ` [PATCH 2/3] Add test of quota accounting using fsx Jan Kara
2010-05-18 23:36 ` [PATCH 3/3] Add quota test with fsstress Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox