All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make xfs/293 more robust
@ 2017-04-19 18:09 Eric Sandeen
  2017-04-19 18:56 ` Darrick J. Wong
  2017-04-19 19:25 ` [PATCH V2] " Eric Sandeen
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Sandeen @ 2017-04-19 18:09 UTC (permalink / raw)
  To: fstests

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
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] make xfs/293 more robust
  2017-04-19 18:09 [PATCH] make xfs/293 more robust Eric Sandeen
@ 2017-04-19 18:56 ` Darrick J. Wong
  2017-04-19 19:05   ` Eric Sandeen
  2017-04-19 19:25 ` [PATCH V2] " Eric Sandeen
  1 sibling, 1 reply; 6+ messages in thread
From: Darrick J. Wong @ 2017-04-19 18:56 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: fstests

On Wed, Apr 19, 2017 at 01:09:45PM -0500, Eric Sandeen wrote:
> 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.

The man manpage on my system says it only ever supports .Z, .z, or .gz.

> 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

Ewwww...

case "$MANPAGE" in
*.gz)	CAT=zcat;;
*.bz2)	CAT=bzcat;;
*.exe)	CAT="FORMAT /U C:";;
*)	CAT=cat;;
esac

--D

> +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
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] make xfs/293 more robust
  2017-04-19 18:56 ` Darrick J. Wong
@ 2017-04-19 19:05   ` Eric Sandeen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2017-04-19 19:05 UTC (permalink / raw)
  To: Darrick J. Wong, Eric Sandeen; +Cc: fstests



On 4/19/17 1:56 PM, Darrick J. Wong wrote:
> On Wed, Apr 19, 2017 at 01:09:45PM -0500, Eric Sandeen wrote:
>> 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.
> 
> The man manpage on my system says it only ever supports .Z, .z, or .gz.

for now! ;)

>> 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
> 
> Ewwww...
> 
> case "$MANPAGE" in
> *.gz)	CAT=zcat;;
> *.bz2)	CAT=bzcat;;
> *.exe)	CAT="FORMAT /U C:";;
> *)	CAT=cat;;
> esac

Hehe, I knew there was a better way, but I'm not ashamed of
not being a bash expert ;)

-Eric

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH V2] make xfs/293 more robust
  2017-04-19 18:09 [PATCH] make xfs/293 more robust Eric Sandeen
  2017-04-19 18:56 ` Darrick J. Wong
@ 2017-04-19 19:25 ` Eric Sandeen
  2017-04-19 22:51   ` Darrick J. Wong
  2017-04-20 15:30   ` [PATCH V3] " Eric Sandeen
  1 sibling, 2 replies; 6+ messages in thread
From: Eric Sandeen @ 2017-04-19 19:25 UTC (permalink / raw)
  To: Eric Sandeen, fstests

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>
---

V2: reduce cat assignment derp
    use _require_command instead of hand-rolling it

diff --git a/tests/xfs/293 b/tests/xfs/293
index ade6015..749205a 100755
--- a/tests/xfs/293
+++ b/tests/xfs/293
@@ -48,8 +48,19 @@ _supported_os IRIX Linux
 
 echo "Silence is golden"
 
+MANPAGE=`man --path xfs_io`
+
+case "$MANPAGE" in
+*.gz)	CAT=zcat;;
+*.bz2)	CAT=bzcat;;
+*.xz)	CAT=xzcat;;
+*)	CAT=cat;;
+esac
+
+_require_command `which $CAT` $CAT
+
 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
 



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH V2] make xfs/293 more robust
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Darrick J. Wong @ 2017-04-19 22:51 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, fstests

On Wed, Apr 19, 2017 at 02:25:44PM -0500, Eric Sandeen wrote:
> 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>
> ---
> 
> V2: reduce cat assignment derp
>     use _require_command instead of hand-rolling it
> 
> diff --git a/tests/xfs/293 b/tests/xfs/293
> index ade6015..749205a 100755
> --- a/tests/xfs/293
> +++ b/tests/xfs/293
> @@ -48,8 +48,19 @@ _supported_os IRIX Linux
>  
>  echo "Silence is golden"
>  
> +MANPAGE=`man --path xfs_io`
> +
> +case "$MANPAGE" in
> +*.gz)	CAT=zcat;;

What about .z and .Z files? :)

Those are also gzip files, but with weird extensions because ... eh.

Granted I bet few people /have/ .z files.

But I guess we could be over-pedantic just in case someone wants to go
all retro with umsdos and whatever.  Or I guess if we start charging by
the byte for filenames.

--D

> +*.bz2)	CAT=bzcat;;
> +*.xz)	CAT=xzcat;;
> +*)	CAT=cat;;
> +esac
> +
> +_require_command `which $CAT` $CAT
> +
>  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
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH V3] make xfs/293 more robust
  2017-04-19 19:25 ` [PATCH V2] " Eric Sandeen
  2017-04-19 22:51   ` Darrick J. Wong
@ 2017-04-20 15:30   ` Eric Sandeen
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2017-04-20 15:30 UTC (permalink / raw)
  To: fstests, Darrick J. Wong

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>
---

V2: reduce cat assignment derp
    use _require_command instead of hand-rolling it

V3: all the gzips.

diff --git a/tests/xfs/293 b/tests/xfs/293
index ade6015..df44e98 100755
--- a/tests/xfs/293
+++ b/tests/xfs/293
@@ -48,8 +48,19 @@ _supported_os IRIX Linux
 
 echo "Silence is golden"
 
+MANPAGE=`man --path xfs_io`
+
+case "$MANPAGE" in
+*.gz|*.z\|*.Z)	CAT=zcat;;
+*.bz2)		CAT=bzcat;;
+*.xz)		CAT=xzcat;;
+*)		CAT=cat;;
+esac
+
+_require_command `which $CAT` $CAT
+
 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
 



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-20 15:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-19 18:09 [PATCH] make xfs/293 more robust Eric Sandeen
2017-04-19 18:56 ` 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

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.