All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs/263: test xfs_quota "state" command
@ 2016-08-12 22:53 Eric Sandeen
  2016-08-15  5:36 ` Eryu Guan
  2016-08-16  3:23 ` [PATCH V2] " Eric Sandeen
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Sandeen @ 2016-08-12 22:53 UTC (permalink / raw)
  To: fstests

This exercises the xfs_quota "state" command for every
combination of user, group, and project quota enablement
on both crc (with project quota inode on disk) and non-crc
(where project quota overlaps group quota on disk) filesystems.

It currently requires patches to the upstream kernel
("quota: fill in Q_XGETQSTAT inode information for inactive quotas")
and to xfsprogs ("xfs_quota: wire up XFS_GETQSTATV") to pass.

Rather than trying to make it run on older kernels without
crc capability, I restrict the test to crc-capable environments,
but test with and without crcs enabled (and hence with and without
project quota inode on disk).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tests/xfs/263 b/tests/xfs/263
new file mode 100755
index 0000000..78d8a72
--- /dev/null
+++ b/tests/xfs/263
@@ -0,0 +1,95 @@
+#! /bin/bash
+# FS QA Test 263
+#
+# test xfs_quota state command
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Red Hat, 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
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+
+_require_scratch
+_require_xfs_quota
+
+# We could test older, non-project capable kernels but keep it simpler;
+# Only test crc and beyond (but we will test with and without the feature)
+_require_xfs_mkfs_crc
+_require_xfs_crc
+
+rm -f $seqres.full
+
+function option_string() {
+	VAL=$1
+	# Treat 3 options as a bit field, prjquota|grpquota|usrquota
+	OPT="rw"
+	if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi; 
+	if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi; 
+	if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi; 
+	echo $OPT
+}
+
+function test_all_state() {
+    for I in `seq 0 7`; do
+	OPTIONS=`option_string $I`
+	echo "== Options: $OPTIONS =="
+	# Some combinations won't mount on V4 supers (grp + prj)
+	_qmount_option "$OPTIONS"
+	_scratch_mount &>> $seqres.full || continue
+	$XFS_QUOTA_PROG -x -c "state" $SCRATCH_MNT | _filter_scratch
+	_scratch_unmount
+    done
+}
+
+echo "==== NO CRC ===="
+# Control size to control inode numbers
+$MKFS_XFS_PROG -f -m crc=0 -n ftype=0 -d size=512m $SCRATCH_DEV >>$seqres.full
+test_all_state
+
+echo "==== CRC ===="
+$MKFS_XFS_PROG -f -m crc=1 -d size=512m $SCRATCH_DEV >>$seqres.full
+test_all_state
+
+status=0
+exit
diff --git a/tests/xfs/263.out b/tests/xfs/263.out
new file mode 100644
index 0000000..70454dd
--- /dev/null
+++ b/tests/xfs/263.out
@@ -0,0 +1,199 @@
+QA output created by 263
+==== NO CRC ====
+== Options: rw ==
+== Options: usrquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,prjquota,rw ==
+== Options: usrquota,grpquota,prjquota,rw ==
+==== CRC ====
+== Options: rw ==
+== Options: usrquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,grpquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
diff --git a/tests/xfs/group b/tests/xfs/group
index 6905a62..fbc4ebf 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -260,6 +260,7 @@
 260 auto quick quota
 261 auto quick quota
 262 auto quick quota
+263 auto quick quota
 265 auto clone
 266 dump ioctl auto quick
 267 dump ioctl tape



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] xfs/263: test xfs_quota "state" command
  2016-08-12 22:53 [PATCH] xfs/263: test xfs_quota "state" command Eric Sandeen
@ 2016-08-15  5:36 ` Eryu Guan
  2016-08-16  2:48   ` Eric Sandeen
  2016-08-16  3:23 ` [PATCH V2] " Eric Sandeen
  1 sibling, 1 reply; 8+ messages in thread
From: Eryu Guan @ 2016-08-15  5:36 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: fstests

On Fri, Aug 12, 2016 at 05:53:04PM -0500, Eric Sandeen wrote:
> This exercises the xfs_quota "state" command for every
> combination of user, group, and project quota enablement
> on both crc (with project quota inode on disk) and non-crc
> (where project quota overlaps group quota on disk) filesystems.
> 
> It currently requires patches to the upstream kernel
> ("quota: fill in Q_XGETQSTAT inode information for inactive quotas")
> and to xfsprogs ("xfs_quota: wire up XFS_GETQSTATV") to pass.

I've applied these patches to kernel (4.8-rc1 based) and xfsprogs
(4.7-rc1 based), and the quota filter fix to xfstests, but I still saw
failures on this, did I miss anything?

[root@dhcp-66-86-11 xfstests]# diff -u tests/xfs/263.out /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad
--- tests/xfs/263.out   2016-08-15 10:56:23.973000000 +0800
+++ /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad        2016-08-15 13:29:48.934000000 +0800
@@ -9,11 +9,11 @@
 Group quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]   
 Inodes grace time: [7 days]   
 Realtime Blocks grace time: [7 days]
@@ -29,7 +29,7 @@
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]   
 Inodes grace time: [7 days]   
 Realtime Blocks grace time: [7 days]
@@ -45,7 +45,7 @@
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]   
 Inodes grace time: [7 days]   
 Realtime Blocks grace time: [7 days]
@@ -57,7 +57,7 @@
 Group quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON
   Enforcement: ON
@@ -73,7 +73,7 @@
 Group quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON
   Enforcement: ON
@@ -93,11 +93,11 @@
 Group quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]
 Inodes grace time: [7 days]
 Realtime Blocks grace time: [7 days]
@@ -113,7 +113,7 @@
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]
 Inodes grace time: [7 days]
 Realtime Blocks grace time: [7 days]
@@ -129,7 +129,7 @@
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: N/A
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]
 Inodes grace time: [7 days]
 Realtime Blocks grace time: [7 days]
@@ -141,7 +141,7 @@
 Group quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: #100 (1 blocks, 1 extents)
+  Inode: #0 (0 blocks, 0 extents)
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON
   Enforcement: ON
@@ -157,7 +157,7 @@
 Group quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: OFF
   Enforcement: OFF
-  Inode: #100 (1 blocks, 1 extents)
+  Inode: #0 (0 blocks, 0 extents)
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON
   Enforcement: ON
@@ -177,7 +177,7 @@
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON
   Enforcement: ON
-  Inode: #101 (1 blocks, 1 extents)
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]
 Inodes grace time: [7 days]
 Realtime Blocks grace time: [7 days]
@@ -193,7 +193,7 @@
 Project quota state on SCRATCH_MNT (SCRATCH_DEV)
   Accounting: ON
   Enforcement: ON
-  Inode: #101 (1 blocks, 1 extents)
+  Inode: #0 (0 blocks, 0 extents)
 Blocks grace time: [7 days]
 Inodes grace time: [7 days]
 Realtime Blocks grace time: [7 days]

> 
> Rather than trying to make it run on older kernels without
> crc capability, I restrict the test to crc-capable environments,
> but test with and without crcs enabled (and hence with and without
> project quota inode on disk).
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> diff --git a/tests/xfs/263 b/tests/xfs/263
> new file mode 100755
> index 0000000..78d8a72
> --- /dev/null
> +++ b/tests/xfs/263
> @@ -0,0 +1,95 @@
> +#! /bin/bash
> +# FS QA Test 263
> +#
> +# test xfs_quota state command
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2016 Red Hat, 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
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +. ./common/quota
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs xfs
> +_supported_os Linux
> +
> +_require_scratch
> +_require_xfs_quota
> +
> +# We could test older, non-project capable kernels but keep it simpler;
> +# Only test crc and beyond (but we will test with and without the feature)
> +_require_xfs_mkfs_crc
> +_require_xfs_crc
> +
> +rm -f $seqres.full
> +
> +function option_string() {

Move "{" to a new line to make it consistent with other tests.

> +	VAL=$1
> +	# Treat 3 options as a bit field, prjquota|grpquota|usrquota
> +	OPT="rw"
> +	if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi; 
> +	if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi; 
> +	if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi; 

Trailing whitespaces in above "if" lines.

> +	echo $OPT
> +}
> +
> +function test_all_state() {
> +    for I in `seq 0 7`; do
> +	OPTIONS=`option_string $I`
> +	echo "== Options: $OPTIONS =="
> +	# Some combinations won't mount on V4 supers (grp + prj)
> +	_qmount_option "$OPTIONS"
> +	_scratch_mount &>> $seqres.full || continue
> +	$XFS_QUOTA_PROG -x -c "state" $SCRATCH_MNT | _filter_scratch
> +	_scratch_unmount
> +    done

This function is mixing tab and space for indention.

Thanks,
Eryu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] xfs/263: test xfs_quota "state" command
  2016-08-15  5:36 ` Eryu Guan
@ 2016-08-16  2:48   ` Eric Sandeen
  2016-08-16  3:15     ` Eric Sandeen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Sandeen @ 2016-08-16  2:48 UTC (permalink / raw)
  To: Eryu Guan, Eric Sandeen; +Cc: fstests



On 8/15/16 12:36 AM, Eryu Guan wrote:
> On Fri, Aug 12, 2016 at 05:53:04PM -0500, Eric Sandeen wrote:
>> This exercises the xfs_quota "state" command for every
>> combination of user, group, and project quota enablement
>> on both crc (with project quota inode on disk) and non-crc
>> (where project quota overlaps group quota on disk) filesystems.
>>
>> It currently requires patches to the upstream kernel
>> ("quota: fill in Q_XGETQSTAT inode information for inactive quotas")
>> and to xfsprogs ("xfs_quota: wire up XFS_GETQSTATV") to pass.
> 
> I've applied these patches to kernel (4.8-rc1 based) and xfsprogs
> (4.7-rc1 based), and the quota filter fix to xfstests, but I still saw
> failures on this, did I miss anything?
> 
> [root@dhcp-66-86-11 xfstests]# diff -u tests/xfs/263.out /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad
> --- tests/xfs/263.out   2016-08-15 10:56:23.973000000 +0800
> +++ /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad        2016-08-15 13:29:48.934000000 +0800
> @@ -9,11 +9,11 @@
>  Group quota state on SCRATCH_MNT (SCRATCH_DEV)
>    Accounting: OFF
>    Enforcement: OFF
> -  Inode: N/A
> +  Inode: #0 (0 blocks, 0 extents)
>  Project quota state on SCRATCH_MNT (SCRATCH_DEV)
>    Accounting: OFF
>    Enforcement: OFF
> -  Inode: N/A
> +  Inode: #0 (0 blocks, 0 extents)

strange, that's the kind of thing the kernel patch was intended to fix.

I meant to retest from scratch on bleeding-edge upstream, but too many
things got in the way today.  Will try again tomorrow...

-Eric

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] xfs/263: test xfs_quota "state" command
  2016-08-16  2:48   ` Eric Sandeen
@ 2016-08-16  3:15     ` Eric Sandeen
  2016-08-16  3:20       ` Eryu Guan
  2016-08-16  3:26       ` Eryu Guan
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Sandeen @ 2016-08-16  3:15 UTC (permalink / raw)
  To: Eryu Guan, Eric Sandeen; +Cc: fstests



On 8/15/16 9:48 PM, Eric Sandeen wrote:
> 
> 
> On 8/15/16 12:36 AM, Eryu Guan wrote:
>> On Fri, Aug 12, 2016 at 05:53:04PM -0500, Eric Sandeen wrote:
>>> This exercises the xfs_quota "state" command for every
>>> combination of user, group, and project quota enablement
>>> on both crc (with project quota inode on disk) and non-crc
>>> (where project quota overlaps group quota on disk) filesystems.
>>>
>>> It currently requires patches to the upstream kernel
>>> ("quota: fill in Q_XGETQSTAT inode information for inactive quotas")
>>> and to xfsprogs ("xfs_quota: wire up XFS_GETQSTATV") to pass.
>>
>> I've applied these patches to kernel (4.8-rc1 based) and xfsprogs
>> (4.7-rc1 based), and the quota filter fix to xfstests, but I still saw
>> failures on this, did I miss anything?
>>
>> [root@dhcp-66-86-11 xfstests]# diff -u tests/xfs/263.out /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad
>> --- tests/xfs/263.out   2016-08-15 10:56:23.973000000 +0800
>> +++ /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad        2016-08-15 13:29:48.934000000 +0800
>> @@ -9,11 +9,11 @@
>>  Group quota state on SCRATCH_MNT (SCRATCH_DEV)
>>    Accounting: OFF
>>    Enforcement: OFF
>> -  Inode: N/A
>> +  Inode: #0 (0 blocks, 0 extents)
>>  Project quota state on SCRATCH_MNT (SCRATCH_DEV)
>>    Accounting: OFF
>>    Enforcement: OFF
>> -  Inode: N/A
>> +  Inode: #0 (0 blocks, 0 extents)
> 
> strange, that's the kind of thing the kernel patch was intended to fix.
> 
> I meant to retest from scratch on bleeding-edge upstream, but too many
> things got in the way today.  Will try again tomorrow...

Can you recheck?  I built everything from scratch on a freshly-installed
box, and with the patches mentioned, it passes for me.

oh, but try V2 of the xfsprogs patch ;)  (I'll send that in a minute).

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] xfs/263: test xfs_quota "state" command
  2016-08-16  3:15     ` Eric Sandeen
@ 2016-08-16  3:20       ` Eryu Guan
  2016-08-16  3:26       ` Eryu Guan
  1 sibling, 0 replies; 8+ messages in thread
From: Eryu Guan @ 2016-08-16  3:20 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, fstests

On Mon, Aug 15, 2016 at 10:15:17PM -0500, Eric Sandeen wrote:
> 
> 
> On 8/15/16 9:48 PM, Eric Sandeen wrote:
> > 
> > 
> > On 8/15/16 12:36 AM, Eryu Guan wrote:
> >> On Fri, Aug 12, 2016 at 05:53:04PM -0500, Eric Sandeen wrote:
> >>> This exercises the xfs_quota "state" command for every
> >>> combination of user, group, and project quota enablement
> >>> on both crc (with project quota inode on disk) and non-crc
> >>> (where project quota overlaps group quota on disk) filesystems.
> >>>
> >>> It currently requires patches to the upstream kernel
> >>> ("quota: fill in Q_XGETQSTAT inode information for inactive quotas")
> >>> and to xfsprogs ("xfs_quota: wire up XFS_GETQSTATV") to pass.
> >>
> >> I've applied these patches to kernel (4.8-rc1 based) and xfsprogs
> >> (4.7-rc1 based), and the quota filter fix to xfstests, but I still saw
> >> failures on this, did I miss anything?
> >>
> >> [root@dhcp-66-86-11 xfstests]# diff -u tests/xfs/263.out /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad
> >> --- tests/xfs/263.out   2016-08-15 10:56:23.973000000 +0800
> >> +++ /root/workspace/xfstests/results//xfs_4k_crc/xfs/263.out.bad        2016-08-15 13:29:48.934000000 +0800
> >> @@ -9,11 +9,11 @@
> >>  Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> >>    Accounting: OFF
> >>    Enforcement: OFF
> >> -  Inode: N/A
> >> +  Inode: #0 (0 blocks, 0 extents)
> >>  Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> >>    Accounting: OFF
> >>    Enforcement: OFF
> >> -  Inode: N/A
> >> +  Inode: #0 (0 blocks, 0 extents)
> > 
> > strange, that's the kind of thing the kernel patch was intended to fix.
> > 
> > I meant to retest from scratch on bleeding-edge upstream, but too many
> > things got in the way today.  Will try again tomorrow...
> 
> Can you recheck?  I built everything from scratch on a freshly-installed
> box, and with the patches mentioned, it passes for me.

Sure, will do.

> 
> oh, but try V2 of the xfsprogs patch ;)  (I'll send that in a minute).

No problem :)

Thanks,
Eryu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH V2] xfs/263: test xfs_quota "state" command
  2016-08-12 22:53 [PATCH] xfs/263: test xfs_quota "state" command Eric Sandeen
  2016-08-15  5:36 ` Eryu Guan
@ 2016-08-16  3:23 ` Eric Sandeen
  2016-08-16 13:34   ` Bill O'Donnell
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Sandeen @ 2016-08-16  3:23 UTC (permalink / raw)
  To: Eric Sandeen, fstests

This exercises the xfs_quota "state" command for every
combination of user, group, and project quota enablement
on both crc (with project quota inode on disk) and non-crc
(where project quota overlaps group quota on disk) filesystems.

It currently requires patches to the upstream kernel
("quota: fill in Q_XGETQSTAT inode information for inactive quotas")
and to xfsprogs ("xfs_quota: wire up XFS_GETQSTATV") to pass.

Rather than trying to make it run on older kernels without
crc capability, I restrict the test to crc-capable environments,
but test with and without crcs enabled (and hence with and without
project quota inode on disk).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: Fix up whitespace nitpicks ;)

diff --git a/tests/xfs/263 b/tests/xfs/263
new file mode 100755
index 0000000..1dc47ae
--- /dev/null
+++ b/tests/xfs/263
@@ -0,0 +1,97 @@
+#! /bin/bash
+# FS QA Test 263
+#
+# test xfs_quota state command
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2016 Red Hat, 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
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs xfs
+_supported_os Linux
+
+_require_scratch
+_require_xfs_quota
+
+# We could test older, non-project capable kernels but keep it simpler;
+# Only test crc and beyond (but we will test with and without the feature)
+_require_xfs_mkfs_crc
+_require_xfs_crc
+
+rm -f $seqres.full
+
+function option_string()
+{
+	VAL=$1
+	# Treat 3 options as a bit field, prjquota|grpquota|usrquota
+	OPT="rw"
+	if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi;
+	if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi;
+	if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi;
+	echo $OPT
+}
+
+function test_all_state()
+{
+	for I in `seq 0 7`; do
+		OPTIONS=`option_string $I`
+		echo "== Options: $OPTIONS =="
+		# Some combinations won't mount on V4 supers (grp + prj)
+		_qmount_option "$OPTIONS"
+		_scratch_mount &>> $seqres.full || continue
+		$XFS_QUOTA_PROG -x -c "state" $SCRATCH_MNT | _filter_scratch
+		_scratch_unmount
+	done
+}
+
+echo "==== NO CRC ===="
+# Control size to control inode numbers
+$MKFS_XFS_PROG -f -m crc=0 -n ftype=0 -d size=512m $SCRATCH_DEV >>$seqres.full
+test_all_state
+
+echo "==== CRC ===="
+$MKFS_XFS_PROG -f -m crc=1 -d size=512m $SCRATCH_DEV >>$seqres.full
+test_all_state
+
+status=0
+exit
diff --git a/tests/xfs/263.out b/tests/xfs/263.out
new file mode 100644
index 0000000..70454dd
--- /dev/null
+++ b/tests/xfs/263.out
@@ -0,0 +1,199 @@
+QA output created by 263
+==== NO CRC ====
+== Options: rw ==
+== Options: usrquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #131 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #132 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,prjquota,rw ==
+== Options: usrquota,grpquota,prjquota,rw ==
+==== CRC ====
+== Options: rw ==
+== Options: usrquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,grpquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: N/A
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: grpquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: OFF
+  Enforcement: OFF
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
+== Options: usrquota,grpquota,prjquota,rw ==
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #99 (1 blocks, 1 extents)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #100 (1 blocks, 1 extents)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+  Accounting: ON
+  Enforcement: ON
+  Inode: #101 (1 blocks, 1 extents)
+Blocks grace time: [7 days]
+Inodes grace time: [7 days]
+Realtime Blocks grace time: [7 days]
diff --git a/tests/xfs/group b/tests/xfs/group
index 6905a62..fbc4ebf 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -260,6 +260,7 @@
 260 auto quick quota
 261 auto quick quota
 262 auto quick quota
+263 auto quick quota
 265 auto clone
 266 dump ioctl auto quick
 267 dump ioctl tape


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] xfs/263: test xfs_quota "state" command
  2016-08-16  3:15     ` Eric Sandeen
  2016-08-16  3:20       ` Eryu Guan
@ 2016-08-16  3:26       ` Eryu Guan
  1 sibling, 0 replies; 8+ messages in thread
From: Eryu Guan @ 2016-08-16  3:26 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, fstests

On Mon, Aug 15, 2016 at 10:15:17PM -0500, Eric Sandeen wrote:
> > strange, that's the kind of thing the kernel patch was intended to fix.
> > 
> > I meant to retest from scratch on bleeding-edge upstream, but too many
> > things got in the way today.  Will try again tomorrow...
> 
> Can you recheck?  I built everything from scratch on a freshly-installed
> box, and with the patches mentioned, it passes for me.
> 
> oh, but try V2 of the xfsprogs patch ;)  (I'll send that in a minute).

The v2 patch of xfsprogs works! Test passed for me too this time.

Thanks,
Eryu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH V2] xfs/263: test xfs_quota "state" command
  2016-08-16  3:23 ` [PATCH V2] " Eric Sandeen
@ 2016-08-16 13:34   ` Bill O'Donnell
  0 siblings, 0 replies; 8+ messages in thread
From: Bill O'Donnell @ 2016-08-16 13:34 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, fstests

On Mon, Aug 15, 2016 at 10:23:11PM -0500, Eric Sandeen wrote:
> This exercises the xfs_quota "state" command for every
> combination of user, group, and project quota enablement
> on both crc (with project quota inode on disk) and non-crc
> (where project quota overlaps group quota on disk) filesystems.
> 
> It currently requires patches to the upstream kernel
> ("quota: fill in Q_XGETQSTAT inode information for inactive quotas")
> and to xfsprogs ("xfs_quota: wire up XFS_GETQSTATV") to pass.
> 
> Rather than trying to make it run on older kernels without
> crc capability, I restrict the test to crc-capable environments,
> but test with and without crcs enabled (and hence with and without
> project quota inode on disk).
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> ---
> 
> V2: Fix up whitespace nitpicks ;)
> 
> diff --git a/tests/xfs/263 b/tests/xfs/263
> new file mode 100755
> index 0000000..1dc47ae
> --- /dev/null
> +++ b/tests/xfs/263
> @@ -0,0 +1,97 @@
> +#! /bin/bash
> +# FS QA Test 263
> +#
> +# test xfs_quota state command
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2016 Red Hat, 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
> +#-----------------------------------------------------------------------
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +. ./common/quota
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs xfs
> +_supported_os Linux
> +
> +_require_scratch
> +_require_xfs_quota
> +
> +# We could test older, non-project capable kernels but keep it simpler;
> +# Only test crc and beyond (but we will test with and without the feature)
> +_require_xfs_mkfs_crc
> +_require_xfs_crc
> +
> +rm -f $seqres.full
> +
> +function option_string()
> +{
> +	VAL=$1
> +	# Treat 3 options as a bit field, prjquota|grpquota|usrquota
> +	OPT="rw"
> +	if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi;
> +	if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi;
> +	if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi;
> +	echo $OPT
> +}
> +
> +function test_all_state()
> +{
> +	for I in `seq 0 7`; do
> +		OPTIONS=`option_string $I`
> +		echo "== Options: $OPTIONS =="
> +		# Some combinations won't mount on V4 supers (grp + prj)
> +		_qmount_option "$OPTIONS"
> +		_scratch_mount &>> $seqres.full || continue
> +		$XFS_QUOTA_PROG -x -c "state" $SCRATCH_MNT | _filter_scratch
> +		_scratch_unmount
> +	done
> +}
> +
> +echo "==== NO CRC ===="
> +# Control size to control inode numbers
> +$MKFS_XFS_PROG -f -m crc=0 -n ftype=0 -d size=512m $SCRATCH_DEV >>$seqres.full
> +test_all_state
> +
> +echo "==== CRC ===="
> +$MKFS_XFS_PROG -f -m crc=1 -d size=512m $SCRATCH_DEV >>$seqres.full
> +test_all_state
> +
> +status=0
> +exit
> diff --git a/tests/xfs/263.out b/tests/xfs/263.out
> new file mode 100644
> index 0000000..70454dd
> --- /dev/null
> +++ b/tests/xfs/263.out
> @@ -0,0 +1,199 @@
> +QA output created by 263
> +==== NO CRC ====
> +== Options: rw ==
> +== Options: usrquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #131 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: grpquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: #131 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #132 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: usrquota,grpquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #131 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #132 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: prjquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: #131 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #132 (1 blocks, 1 extents)
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: usrquota,prjquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #131 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #132 (1 blocks, 1 extents)
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: grpquota,prjquota,rw ==
> +== Options: usrquota,grpquota,prjquota,rw ==
> +==== CRC ====
> +== Options: rw ==
> +== Options: usrquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #99 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: grpquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: #99 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #100 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: usrquota,grpquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #99 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #100 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: N/A
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: prjquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: #99 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: #100 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #101 (1 blocks, 1 extents)
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: usrquota,prjquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #99 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: #100 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #101 (1 blocks, 1 extents)
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: grpquota,prjquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: OFF
> +  Enforcement: OFF
> +  Inode: #99 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #100 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #101 (1 blocks, 1 extents)
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> +== Options: usrquota,grpquota,prjquota,rw ==
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #99 (1 blocks, 1 extents)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #100 (1 blocks, 1 extents)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> +  Accounting: ON
> +  Enforcement: ON
> +  Inode: #101 (1 blocks, 1 extents)
> +Blocks grace time: [7 days]
> +Inodes grace time: [7 days]
> +Realtime Blocks grace time: [7 days]
> diff --git a/tests/xfs/group b/tests/xfs/group
> index 6905a62..fbc4ebf 100644
> --- a/tests/xfs/group
> +++ b/tests/xfs/group
> @@ -260,6 +260,7 @@
>  260 auto quick quota
>  261 auto quick quota
>  262 auto quick quota
> +263 auto quick quota
>  265 auto clone
>  266 dump ioctl auto quick
>  267 dump ioctl tape
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-08-16 13:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-12 22:53 [PATCH] xfs/263: test xfs_quota "state" command Eric Sandeen
2016-08-15  5:36 ` Eryu Guan
2016-08-16  2:48   ` Eric Sandeen
2016-08-16  3:15     ` Eric Sandeen
2016-08-16  3:20       ` Eryu Guan
2016-08-16  3:26       ` Eryu Guan
2016-08-16  3:23 ` [PATCH V2] " Eric Sandeen
2016-08-16 13:34   ` Bill O'Donnell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.