From patchwork Fri Jun 17 01:46:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 9182301 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 6FF6A60573 for ; Fri, 17 Jun 2016 01:47:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FA09283A2 for ; Fri, 17 Jun 2016 01:47:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5082D283A8; Fri, 17 Jun 2016 01:47:18 +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, UNPARSEABLE_RELAY 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 DF6E8283A2 for ; Fri, 17 Jun 2016 01:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755199AbcFQBrI (ORCPT ); Thu, 16 Jun 2016 21:47:08 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:35332 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755177AbcFQBrG (ORCPT ); Thu, 16 Jun 2016 21:47:06 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u5H1kvKO026477 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Jun 2016 01:46:57 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u5H1kuIQ008154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Jun 2016 01:46:56 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id u5H1ksDQ014524; Fri, 17 Jun 2016 01:46:55 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Jun 2016 18:46:54 -0700 Subject: [PATCH 08/20] xfs/122: don't break on old xfsprogs From: "Darrick J. Wong" To: david@fromorbit.com, darrick.wong@oracle.com Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, xfs@oss.sgi.com Date: Thu, 16 Jun 2016 18:46:52 -0700 Message-ID: <146612801269.25024.6120665241562735488.stgit@birch.djwong.org> In-Reply-To: <146612796204.25024.18254357523133394284.stgit@birch.djwong.org> References: <146612796204.25024.18254357523133394284.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we're running against a old version of xfsprogs that lacks some of the structures that the golden output knows about, copy the structure size definition from the golden output to the program output. This way we can check for structure size mutations on old xfsprogs without generating false error reports for structs that don't exist in the old release. v2: Remove the xfsprogs 2.9.8 compatibility cruft. Signed-off-by: Darrick J. Wong --- tests/xfs/122 | 17 ++++++----------- tests/xfs/122.out | 1 + 2 files changed, 7 insertions(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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/122 b/tests/xfs/122 index 845cdd2..330d3ac 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -73,6 +73,7 @@ _attribute_filter() cprog=$tmp.get_structs.c oprog=$tmp.get_structs progout=$tmp.output +keyfile=$tmp.keys cat >$cprog <> $seqres.full 2>&1 || \ _notrun "Could not compile test program (see end of $seqres.full)" $oprog | _type_size_filter | _type_name_filter > $progout -# -# add addition sizes and xfs_sb_t fields that don't exist in the version -# being tested. -# +# Find all the items that only exist in the golden output +comm -23 <(grep '=' $0.out | sed -e 's/ =.*$//g' | LC_COLLATE=POSIX sort) \ + <(sed -e 's/ =.*$//g' < $progout | LC_COLLATE=POSIX sort) > $keyfile -# xfsprogs 2.9.8: sb_bad_features2 in pv 978822 -if [ $XFSPROGS_VERSION -lt 20908 ]; then - echo 'offsetof(xfs_sb_t, sb_bad_features2 ) = 204' >>$progout -fi -if [ $XFSPROGS_VERSION -lt 30000 ]; then - echo 'sizeof( xfs_dsb_t ) = 208' >>$progout; -fi +# Copy those items to the program output +grep -F -f $keyfile $0.out >> $progout LC_COLLATE=POSIX sort $progout diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 451871e..46d1dd4 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -147,3 +147,4 @@ sizeof(xfs_lookup_t) = 4 sizeof(xfs_qoff_logformat_t) = 20 sizeof(xfs_timestamp_t) = 8 sizeof(xfs_trans_header_t) = 16 +sizeof(xfs_zzzz_test_the_test_program) = -47