From patchwork Thu Aug 18 03:09:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 9286731 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 2B43760839 for ; Thu, 18 Aug 2016 03:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1180A2909D for ; Thu, 18 Aug 2016 03:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 019C7290A5; Thu, 18 Aug 2016 03:12:36 +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 72A152909D for ; Thu, 18 Aug 2016 03:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753533AbcHRDMf (ORCPT ); Wed, 17 Aug 2016 23:12:35 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:27520 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753542AbcHRDMe (ORCPT ); Wed, 17 Aug 2016 23:12:34 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="10029166" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 18 Aug 2016 11:12:27 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id C9A4842BC508; Thu, 18 Aug 2016 11:12:26 +0800 (CST) Received: from localhost.localdomain (10.167.220.69) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.279.2; Thu, 18 Aug 2016 11:12:25 +0800 From: Xiao Yang To: CC: , , Xiao Yang Subject: [PATCH v3] xfs/191: skip tests on older xfsprogs Date: Thu, 18 Aug 2016 11:09:16 +0800 Message-ID: <1471489756-7659-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20160818010410.GB22388@dastard> References: <20160818010410.GB22388@dastard> MIME-Version: 1.0 X-Originating-IP: [10.167.220.69] X-yoursite-MailScanner-ID: C9A4842BC508.AA827 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we don't have temp file used to test on xfsprogs 3.2.2, _require_xfs_mkfs_validation will fail because mkfs.xfs can't create this file. We need to skip tests before xfsprogs 4.7.0, so fix it. the feature has been introduced since xfsprogs 4.2.0: Commit 20cec860e16b267ea0c71a2f648fa2b26aad2e65 Author: Eric Sandeen Date: Fri Jul 31 09:04:11 2015 +1000 mkfs.xfs: always use underlying fs sector size when mkfs'ing a file Signed-off-by: Xiao Yang --- common/rc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/common/rc b/common/rc index b19b698..b716d26 100644 --- a/common/rc +++ b/common/rc @@ -3887,21 +3887,25 @@ _get_fs_sysfs_attr() # # At first, make a common function that runs the tests and returns # number of failed cases. -_mkfs_validation_check() +_xfs_mkfs_validation_check() { - local cmd="$MKFS_XFS_PROG -f -N -d file,name=/tmp/foo,size=$((1024 * 1024 * 1024))" + local tmpfile=`mktemp` + local cmd="$MKFS_XFS_PROG -f -N -d file,name=$tmpfile,size=1g" + $cmd -s size=2s >/dev/null 2>&1 local sum=$? - $cmd -l version=2,su=$((256 * 1024 + 4096)) >/dev/null 2>&1 + + $cmd -l version=2,su=260k >/dev/null 2>&1 sum=`expr $sum + $?` - rm -f /tmp/foo + + rm -f $tmpfile return $sum } # Skip the test if all calls passed - mkfs accepts invalid input _require_xfs_mkfs_validation() { - _mkfs_validation_check + _xfs_mkfs_validation_check if [ "$?" -eq 0 ]; then _notrun "Requires newer mkfs with stricter input checks: the oldest supported version of xfsprogs is 4.7." fi @@ -3910,7 +3914,7 @@ _require_xfs_mkfs_validation() # The oposite of _require_xfs_mkfs_validation. _require_xfs_mkfs_without_validation() { - _mkfs_validation_check + _xfs_mkfs_validation_check if [ "$?" -ne 0 ]; then _notrun "Requires older mkfs without strict input checks: the last supported version of xfsprogs is 4.5." fi