From patchwork Wed Apr 19 18:09:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9688595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F3F80602C9 for ; Wed, 19 Apr 2017 18:09:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E92C8283E8 for ; Wed, 19 Apr 2017 18:09:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB97728433; Wed, 19 Apr 2017 18:09:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 708FA283E8 for ; Wed, 19 Apr 2017 18:09:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966558AbdDSSJr (ORCPT ); Wed, 19 Apr 2017 14:09:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34298 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966537AbdDSSJq (ORCPT ); Wed, 19 Apr 2017 14:09:46 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 106AF80F9F for ; Wed, 19 Apr 2017 18:09:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 106AF80F9F Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sandeen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 106AF80F9F Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDECF18987 for ; Wed, 19 Apr 2017 18:09:45 +0000 (UTC) To: fstests From: Eric Sandeen Subject: [PATCH] make xfs/293 more robust Message-ID: Date: Wed, 19 Apr 2017 13:09:45 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 19 Apr 2017 18:09:46 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- -- 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 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