[PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id

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

 



With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
xfs/133 fails as

     Filesystem Blocks Quota Limit Warn/Time Mounted on
     SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
     === report command output ===
    +(null) 0 0 0 00 [--------]
     123456-project 0 102400 204800 00 [--------]

Fix it by limiting xfs_quota to report on specific project quota number
using -L & -U option, so only the project quota being tested is
reported.

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

I'm not sure if kernel should be fixed, but limiting the quota report on
project number being tested seems something worth doing to me anyway. It avoids
breakage of future changes of quota report output.

 tests/xfs/133     |  8 +++++---
 tests/xfs/133.out |  2 +-
 tests/xfs/134     | 22 +++++++++++++++-------
 tests/xfs/262     |  6 ++++--
 4 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/tests/xfs/133 b/tests/xfs/133
index 82c38b1..7a0e55e 100755
--- a/tests/xfs/133
+++ b/tests/xfs/133
@@ -57,16 +57,17 @@ do_project_test()
 {
 	local qa_project=123456-project
 	local dir=$SCRATCH_MNT/project
+	local proj_num=10
 
 	mkdir $dir 2>/dev/null
 
 	#project quota files
 	cat >$tmp.projects <<EOF
-10:$dir
+$proj_num:$dir
 EOF
 
 	cat >$tmp.projid <<EOF
-$qa_project:10
+$qa_project:$proj_num
 EOF
 
 	$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
@@ -81,7 +82,8 @@ 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 -L $proj_num -U $proj_num" \
+		$SCRATCH_MNT | _filter_quota
 }
 
 # Test project
diff --git a/tests/xfs/133.out b/tests/xfs/133.out
index 21cfd0d..8c747bf 100644
--- a/tests/xfs/133.out
+++ b/tests/xfs/133.out
@@ -4,5 +4,5 @@ Disk quotas for Project 123456-project (10)
 Filesystem Blocks Quota Limit Warn/Time Mounted on
 SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
 === report command output ===
-123456-project 0 102400 204800 00 [--------]
+#10 0 102400 204800 00 [--------]
 
diff --git a/tests/xfs/134 b/tests/xfs/134
index be18ee8..5ba275c 100755
--- a/tests/xfs/134
+++ b/tests/xfs/134
@@ -54,12 +54,13 @@ _require_xfs_quota
 dir=$SCRATCH_MNT/project
 
 #project quota files
+proj_num=1
 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 \
+$XFS_QUOTA_PROG -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:]'
+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,12 @@ 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
diff --git a/tests/xfs/262 b/tests/xfs/262
index 9d8b838..d3a352c 100755
--- a/tests/xfs/262
+++ b/tests/xfs/262
@@ -138,11 +138,13 @@ _quota_cmd "limit -p bhard=${qlimit_meg}m bsoft=${qlimit_meg}m ${proj_name}" \
 							2>> "$seqres.full" 1>&2
 
 # See what gets reported
-_quota_cmd "report"		| _filter_quota_rpt	2>> "$seqres.full"
+_quota_cmd "report -U $proj_num -L $proj_num" | _filter_quota_rpt \
+							2>> $seqres.full
 _quota_cmd "df"			| _filter_quota_rpt	2>> "$seqres.full"
 
 # This time using "human readable" output
-_quota_cmd "report -h"		| _filter_quota_rpt	2>> "$seqres.full"
+_quota_cmd "report -h $proj_num -L $proj_num" | _filter_quota_rpt \
+							2>> "$seqres.full"
 _quota_cmd "df -h"		| _filter_quota_rpt	2>> "$seqres.full"
 
 # Clean up
-- 
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