From: Anju T Sudhakar <anju@linux.vnet.ibm.com>
To: fstests@vger.kernel.org
Cc: anju@linux.vnet.ibm.com
Subject: [PATCH 2/3] xfs/514: Check xfsprogs version for verifying the xfs_db commands
Date: Mon, 28 Jun 2021 14:22:58 +0530 [thread overview]
Message-ID: <20210628085259.120666-3-anju@linux.vnet.ibm.com> (raw)
In-Reply-To: <20210628085259.120666-1-anju@linux.vnet.ibm.com>
xfs_db commands like `attr_remove, attr_set, btheight, and logformat`,
are documented only in xfsprogs version v5.5 and later. So skip checking
for these commands in xfs_db manpage,if the test is running with
xfsprogs version less than v5.5.
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
---
Query: The reason to add this check is, while running xfstest with an
older version of xfsprogs, this test case flags as failure, though
xfs_db is not expected to have those commands. Otherwise upon failure we
should ask the user to use the latest version of xfsprogs.
OR is there any better solution for this?
tests/xfs/514 | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/xfs/514 b/tests/xfs/514
index a9c67645..8da66f41 100755
--- a/tests/xfs/514
+++ b/tests/xfs/514
@@ -27,6 +27,11 @@ _require_test
echo "Silence is golden"
MANPAGE=$($MAN_PROG --path xfs_db)
+# xfs_db commands - attr_remove, attr_set, btheight, and logformat
+# are documented in 5.5.0 and later versions only. So skip checking for
+# those commands if the version is less than 5.5.0.
+command_list="attr_set attr_remove btheight logformat"
+req_version=$($XFS_DB_PROG -V | cut -d" " -f3)
case "$MANPAGE" in
*.gz|*.z\|*.Z) CAT=zcat;;
@@ -41,7 +46,12 @@ truncate -s 128m $file
$MKFS_XFS_PROG $file >> /dev/null
for COMMAND in `$XFS_DB_PROG -x -c help $file | awk '{print $1}' | grep -v "^Use"`; do
- $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
+ if [ "$req_version" \< "5.5.0" ]; then
+ if (echo $command_list | tr ' ' '\n' | grep -F -x -q "$COMMAND");then
+ continue
+ fi
+ fi
+ $CAT "$MANPAGE" | egrep -q "^\.B.*$COMMAND" || \
echo "$COMMAND not documented in the xfs_db manpage"
done
--
2.31.1
next prev parent reply other threads:[~2021-06-28 8:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-28 8:52 [PATCH 0/3] xfstest random fixes Anju T Sudhakar
2021-06-28 8:52 ` [PATCH 1/3] xfs/504: Add scratch_mount before checking for xfs_scrub unicode support Anju T Sudhakar
2021-06-28 15:43 ` Darrick J. Wong
2021-06-28 8:52 ` Anju T Sudhakar [this message]
2021-06-28 14:16 ` [PATCH 2/3] xfs/514: Check xfsprogs version for verifying the xfs_db commands Zorro Lang
2021-06-28 15:35 ` Darrick J. Wong
2021-07-04 7:29 ` Anju T Sudhakar
2021-06-28 8:52 ` [PATCH 3/3] xfs/515: Check xfsprogs version for testing xfs_quota commands Anju T Sudhakar
2021-06-28 14:19 ` Zorro Lang
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=20210628085259.120666-3-anju@linux.vnet.ibm.com \
--to=anju@linux.vnet.ibm.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