From patchwork Thu Apr 20 15:30:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 9690817 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 4E62760383 for ; Thu, 20 Apr 2017 15:30:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A8D41FF60 for ; Thu, 20 Apr 2017 15:30:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F51A28433; Thu, 20 Apr 2017 15:30: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 CBE721FF60 for ; Thu, 20 Apr 2017 15:30:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970593AbdDTPaq (ORCPT ); Thu, 20 Apr 2017 11:30:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49406 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970619AbdDTPai (ORCPT ); Thu, 20 Apr 2017 11:30:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A05DD9F727; Thu, 20 Apr 2017 15:30:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A05DD9F727 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sandeen@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A05DD9F727 Received: from [IPv6:::1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 671F480B2E; Thu, 20 Apr 2017 15:30:37 +0000 (UTC) Subject: [PATCH V3] make xfs/293 more robust To: fstests , "Darrick J. Wong" References: <6e4cecf7-dbcf-3cf3-22e0-50e8e1e859fd@sandeen.net> From: Eric Sandeen Message-ID: Date: Thu, 20 Apr 2017 10:30:36 -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 In-Reply-To: <6e4cecf7-dbcf-3cf3-22e0-50e8e1e859fd@sandeen.net> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 20 Apr 2017 15:30:37 +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 --- V2: reduce cat assignment derp use _require_command instead of hand-rolling it V3: all the gzips. -- 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..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