All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: fstests <fstests@vger.kernel.org>
Subject: [PATCH] make xfs/293 more robust
Date: Wed, 19 Apr 2017 13:09:45 -0500	[thread overview]
Message-ID: <bf7bdb00-59d0-2283-e040-af1e86f14b95@redhat.com> (raw)

xfs/293 is supposed to make sure every command in xfs_io
is documented, but it was missing the inode command because
it's a common word, and depending on how man formatted the
page, the magic "   inode" string could show up and appear
to indicate that documentation is present for the command
when it's not actually there.

Change the test to inspect the manpage source directly, with
the assumption that each documented command will start
with ^\.B.*$COMMAND on a manpage line.

This handles a few different compressed manpage formats -
I don't know if anybody uses bz2 or xz, but hey.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/tests/xfs/293 b/tests/xfs/293
index ade6015..a342cb6 100755
--- a/tests/xfs/293
+++ b/tests/xfs/293
@@ -48,8 +48,24 @@ _supported_os IRIX Linux
 
 echo "Silence is golden"
 
+MANPAGE=`man --path xfs_io`
+
+[ -z "$MANPAGE" ] && _notrun "xfs_io manpage not found"
+
+if `echo $MANPAGE | grep -q .gz$`; then
+	CAT=zcat
+elif `echo $MANPAGE | grep -q .bz2$`; then
+	CAT=bzcat
+elif `echo $MANPAGE | grep -q .xz$`; then
+	CAT=xzcat
+else
+	CAT=cat
+fi
+
+which $CAT &>/dev/null || _notrun "$CAT utility not found"
+
 for COMMAND in `$XFS_IO_PROG -c help | awk '{print $1}' | grep -v "^Use"`; do
-  man xfs_io | col -b | grep -wq "   $COMMAND" || \
+  $CAT `man --path xfs_io` | egrep -q "^\.B.*$COMMAND" || \
 	echo "$COMMAND not documented in the xfs_io manpage"
 done
 


             reply	other threads:[~2017-04-19 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 18:09 Eric Sandeen [this message]
2017-04-19 18:56 ` [PATCH] make xfs/293 more robust Darrick J. Wong
2017-04-19 19:05   ` Eric Sandeen
2017-04-19 19:25 ` [PATCH V2] " Eric Sandeen
2017-04-19 22:51   ` Darrick J. Wong
2017-04-20 15:30   ` [PATCH V3] " Eric Sandeen

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=bf7bdb00-59d0-2283-e040-af1e86f14b95@redhat.com \
    --to=sandeen@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.