From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: <jack@suse.cz>, <fstests@vger.kernel.org>
Cc: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Subject: [PATCH] generic/386: get right field in df command
Date: Tue, 17 Dec 2019 13:20:51 +0800 [thread overview]
Message-ID: <1576560051-31851-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> (raw)
Since xfstests commit 5568077041bb ("generic/386: Fix _filter_quota_rpt"),
this case outputs things. And it fails on ext4 as below:
--------------------------
QA output created by 386
Silence is golden.
hard limit 524283904 bytes, expected 524288000
hard limit 500 bytes, expected 524288000
--------------------------
the df command doesn't get expected output, origial output as below:
--------------------------
for df:
Filesystem 1K-blocks Used Available Use% Pathname
/dev/sda11 20511312 45108 20466204 0% /mnt/xfstests/scratch
/dev/sda11 512000 4 511996 0% /mnt/xfstests/scratch/test
for df -h command:
Filesystem Size Used Avail Use% Pathname
/dev/sda11 19.6G 44.1M 19.5G 0% /mnt/xfstests/scratch
/dev/sda11 500M 4K 500.0M 0% /mnt/xfstests/scratch/test
--------------------------
It fails because ext4 project quota hides on common inode instead of superblock
inode, so it has used 1 block. Also, the "df -h" fails because byte_size() only
can parse integer value correctly. So, I think we can get size/1k-blocks instead
of Avail/Available field in this case.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
tests/generic/386 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/generic/386 b/tests/generic/386
index 0c44c80e..a39621e7 100755
--- a/tests/generic/386
+++ b/tests/generic/386
@@ -63,7 +63,7 @@ _require_scratch
# interested in contains our project name in the first field. For "df"
# it contains our project directory in the last field.
# But if the device name is too long, the "df" output is broke into two
-# lines, the fourth field is not correct, so take $(NF-2) of "df"
+# lines, the second field is not correct, so take $(NF-4) of "df".
_filter_quota_rpt() {
awk '
BEGIN {
@@ -89,7 +89,7 @@ _filter_quota_rpt() {
bsize = byte_size($4);
} else if ($NF ~ proj_dir) {
# this is the "df" output
- bsize = byte_size($(NF-2));
+ bsize = byte_size($(NF-4));
} else {
next;
}
--
2.18.0
reply other threads:[~2019-12-17 5:20 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=1576560051-31851-1-git-send-email-xuyang2018.jy@cn.fujitsu.com \
--to=xuyang2018.jy@cn.fujitsu.com \
--cc=fstests@vger.kernel.org \
--cc=jack@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).