From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Subject: [PATCH] common/quota: sort lines of repquota output
Date: Mon, 21 May 2018 00:22:02 +0800 [thread overview]
Message-ID: <20180520162202.13567-1-zlang@redhat.com> (raw)
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>
---
common/quota | 4 ++--
tests/xfs/330 | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/quota b/common/quota
index f01bd068..68c350ee 100644
--- a/common/quota
+++ b/common/quota
@@ -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
diff --git a/tests/xfs/330 b/tests/xfs/330
index 8260bdda..d49f2723 100755
--- a/tests/xfs/330
+++ b/tests/xfs/330
@@ -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"
--
2.14.3
reply other threads:[~2018-05-20 16:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180520162202.13567-1-zlang@redhat.com \
--to=zlang@redhat.com \
--cc=fstests@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox