[PATCH] xfs/133 134: filter redundant projid 0 quota report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After GETNEXTQUOTA ioctl be supported, xfs_quota -c "report" always
outputs one more quota info about default quota (as project ID 0).
For fix this problem, xfsprogs has merged commit 3d607a1.

Now xfstests face this same problem from this issue. xfs/133 and
xfs/134 can't match their golden output, due to this one more line
quota report output. So this patch filter this redundant quota info.

Signed-off-by: Zorro Lang <zlang@xxxxxxxxxx>
Signed-off-by: Eryu Guan <eguan@xxxxxxxxxx>
---

Hi,

We found this problem when:
http://thread.gmane.org/gmane.comp.file-systems.fstests/1852/focus=1968

But we didn't make a suitable decision about how to deal with it. Then
Eryu hit this problem again and wrote a patch for xfstests:
http://oss.sgi.com/archives/xfs/2016-04/msg00002.html

This pushed us decide to fix this problem. Now xfsprogs commit 3d607a1
has been merged to resolve this problem. But after that xfstests still
face one more line quota report problem, so I modify some code of Eryu's
old patch, and send this new patch for fix that.

Thanks,
Zorro

 tests/xfs/133 |  3 ++-
 tests/xfs/134 | 27 +++++++++++++++++----------
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/tests/xfs/133 b/tests/xfs/133
index 82c38b1..ebf008b 100755
--- a/tests/xfs/133
+++ b/tests/xfs/133
@@ -67,6 +67,7 @@ EOF
 
 	cat >$tmp.projid <<EOF
 $qa_project:10
+root:0
 EOF
 
 	$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
@@ -81,7 +82,7 @@ EOF
 
 	echo "=== report command output ==="
 	$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
-		-c "report -p -N -b" $SCRATCH_MNT | _filter_quota
+		-c "report -p -N -b" $SCRATCH_MNT | _filter_quota | grep -v "^root "
 }
 
 # Test project
diff --git a/tests/xfs/134 b/tests/xfs/134
index be18ee8..a46a734 100755
--- a/tests/xfs/134
+++ b/tests/xfs/134
@@ -52,14 +52,15 @@ _require_test
 _require_xfs_quota
 
 dir=$SCRATCH_MNT/project
+proj_num=1
 
 #project quota files
 cat >$tmp.projects <<EOF
-1:$dir
+${proj_num}:$dir
 EOF
 
 cat >$tmp.projid <<EOF
-test:1
+test:${proj_num}
 EOF
 
 cp /dev/null $seqres.full
@@ -87,17 +88,24 @@ fi
 src/feature -p $SCRATCH_DEV
 [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
 
+report_quota()
+{
+    $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
+		    -c "repquota -inN -p -L $proj_num -U $proj_num" \
+		    $SCRATCH_DEV | tr -s '[:space:]'
+}
+
 mkdir $dir
 $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
 
-xfs_quota -D $tmp.projects -P $tmp.projid -x \
-    -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
+    -c "limit -p bsoft=100m bhard=100m $proj_num" $SCRATCH_DEV
+report_quota
+
 touch $dir/1
 touch $dir/2
 cp $dir/2 $dir/3
-
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+report_quota
 
 if [ "$HOSTOS" == "IRIX" ] ; then
     mkfile 1M $TEST_DIR/6
@@ -107,12 +115,11 @@ fi
 
 #try cp to dir
 cp $TEST_DIR/6 $dir/6
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+report_quota
 
 #try mv to dir
 mv $TEST_DIR/6 $dir/7
-
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+report_quota
 
 # success, all done
 status=0
-- 
2.5.5

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux