]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common/quota: sort lines of repquota output
authorZorro Lang <zlang@redhat.com>
Sun, 20 May 2018 16:22:02 +0000 (00:22 +0800)
committerEryu Guan <guaneryu@gmail.com>
Mon, 21 May 2018 08:40:54 +0000 (16:40 +0800)
The golden image of some cases (e.g: generic/305 generic/326
generic/327 generic/328 xfs/214 xfs/330 and xfs/440) depend on the
output of repquota() function.

When it reports multi-users, we can't control the order of lines,
then always hit failures likes:

  ...
   Create the original files
  -root 3072 0 0
   nobody 0 0 0
   fsgqa 0 0 0
  +root 3072 0 0
  ...

So sort the lines to make sure it won't break the golden image.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/quota
tests/xfs/330

index f01bd068383bcad7aaf12e0dd823eabc3c45cfc3..68c350ee5bbb3465bc9de271fd51af54a9ed589a 100644 (file)
@@ -308,12 +308,12 @@ _check_quota_usage()
 
 # Report the block usage of root, $qa_user, and nobody
 _report_quota_blocks() {
-       repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $3, $4, $5}'
+       repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $3, $4, $5}' | sort -r
 }
 
 # Report the inode usage of root, $qa_user, and nobody
 _report_quota_inodes() {
-       repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}'
+       repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}' | sort -r
 }
 
 # make sure this script returns success
index 8260bddaacb0a4b0812c50ee6a55fa6a052e64e4..d49f2723301faf95a1a43e41981df29acaa9e17c 100755 (executable)
@@ -53,7 +53,7 @@ _require_nobody
 
 do_repquota()
 {
-       repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)'
+       repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)' | sort -r
 }
 
 rm -f "$seqres.full"