From patchwork Thu Feb 11 23:40:02 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: 8286641 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EB759BEEE5 for ; Thu, 11 Feb 2016 23:58:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1DA120364 for ; Thu, 11 Feb 2016 23:58:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6E8F20397 for ; Thu, 11 Feb 2016 23:58:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751071AbcBKXke (ORCPT ); Thu, 11 Feb 2016 18:40:34 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:19684 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbcBKXkH (ORCPT ); Thu, 11 Feb 2016 18:40:07 -0500 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 u1BNe4SP032126 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Feb 2016 23:40:04 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNe4nG024251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Thu, 11 Feb 2016 23:40:04 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u1BNe3Si026052; Thu, 11 Feb 2016 23:40:04 GMT Received: from localhost (/10.145.178.207) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Feb 2016 15:40:03 -0800 Subject: [PATCH 07/32] common: create _require_test_program to look for programs in src/ 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, 11 Feb 2016 15:40:02 -0800 Message-ID: <20160211234002.2202.899.stgit@birch.djwong.org> In-Reply-To: <20160211233916.2202.40961.stgit@birch.djwong.org> References: <20160211233916.2202.40961.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: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Create a helper that looks for a test program in src/ and fails the test if it doesn't exist. Refactor the existing testcases to use it. Signed-off-by: Darrick J. Wong --- common/rc | 9 +++++++++ tests/generic/010 | 2 +- tests/generic/094 | 2 +- tests/generic/225 | 2 +- tests/generic/285 | 2 +- tests/generic/286 | 2 +- tests/generic/311 | 2 +- tests/xfs/032 | 3 +-- tests/xfs/044 | 2 +- 9 files changed, 17 insertions(+), 9 deletions(-) -- 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/common/rc b/common/rc index 84f794a..63eb90b 100644 --- a/common/rc +++ b/common/rc @@ -1684,6 +1684,15 @@ _require_aiodio() _require_odirect } +# this test requires that a test program exists under src/ +# $1 - command (require) +# +_require_test_program() +{ + SRC_TEST=src/$1 + [ -x $SRC_TEST ] || _notrun "$SRC_TEST not built" +} + # run an aio-dio program # $1 - command _run_aiodio() diff --git a/tests/generic/010 b/tests/generic/010 index ea8ea50..1c9d8f7 100755 --- a/tests/generic/010 +++ b/tests/generic/010 @@ -51,7 +51,7 @@ _filter_dbtest() . ./common/rc . ./common/filter -[ -x $here/src/dbtest ] || _notrun "dbtest was not built for this platform" +_require_test_program "dbtest" # real QA test starts here _supported_fs generic diff --git a/tests/generic/094 b/tests/generic/094 index 4e4b668..a51738a 100644 --- a/tests/generic/094 +++ b/tests/generic/094 @@ -53,7 +53,7 @@ _scratch_mount > /dev/null 2>&1 rm -f $seqres.full fiemapfile=$SCRATCH_MNT/$seq.fiemap -[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built" +_require_test_program "fiemap-tester" seed=`date +%s` diff --git a/tests/generic/225 b/tests/generic/225 index 6134c8c..c8e0f64 100755 --- a/tests/generic/225 +++ b/tests/generic/225 @@ -53,7 +53,7 @@ rm -f $seqres.full fiemapfile=$SCRATCH_MNT/$seq.fiemap fiemaplog=$SCRATCH_MNT/$seq.log -[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built" +_require_test_program "fiemap-tester" seed=`date +%s` diff --git a/tests/generic/285 b/tests/generic/285 index d6275b5..16e70b1 100755 --- a/tests/generic/285 +++ b/tests/generic/285 @@ -45,7 +45,7 @@ _require_seek_data_hole BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile -[ -x $here/src/seek_sanity_test ] || _notrun "seek_sanitfy_tester not built" +_require_test_program "seek_sanity_test" # Disable extent zeroing for ext4 as that change where holes are created if [ "$FSTYP" = "ext4" ]; then diff --git a/tests/generic/286 b/tests/generic/286 index f6bf356..f88f079 100755 --- a/tests/generic/286 +++ b/tests/generic/286 @@ -44,7 +44,7 @@ _require_seek_data_hole src=$TEST_DIR/seek_copy_testfile dest=$TEST_DIR/seek_copy_testfile.dest -[ -x $here/src/seek_copy_test ] || _notrun "seek_copy_test not built" +_require_test_program "seek_copy_test" _cleanup() { diff --git a/tests/generic/311 b/tests/generic/311 index f552011..69bc1bf 100755 --- a/tests/generic/311 +++ b/tests/generic/311 @@ -62,7 +62,7 @@ _require_metadata_journaling $SCRATCH_DEV # the test system supports fallocate() for allocation _require_xfs_io_command "falloc" -[ -x $here/src/fsync-tester ] || _notrun "fsync-tester not built" +_require_test_program "fsync-tester" rm -f $seqres.full SEED=1 diff --git a/tests/xfs/032 b/tests/xfs/032 index 063f272..6216379 100755 --- a/tests/xfs/032 +++ b/tests/xfs/032 @@ -40,8 +40,7 @@ _supported_fs xfs _supported_os IRIX Linux _require_scratch - -[ $here/src/feature ] || _notrun "src/feature not built, skipping this test" +_require_test_program "feature" [ "$USE_EXTERNAL" = yes ] && _notrun "Cannot xfs_copy with external devices" [ -n "$XFS_COPY_PROG" ] || _notrun "xfs_copy binary not yet installed" diff --git a/tests/xfs/044 b/tests/xfs/044 index 2ffd74f..ea58c07 100755 --- a/tests/xfs/044 +++ b/tests/xfs/044 @@ -124,7 +124,7 @@ _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1 [ $lversion -ne 1 ] && \ _notrun "Cannot run this test yet using MKFS_OPTIONS specified" -[ $here/src/loggen ] || _notrun "loggen not built, skipping test" +_require_test_program "loggen" _check_mount _check_require_logdev