From patchwork Mon Feb 24 11:56:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 3708941 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3F82BBF13A for ; Mon, 24 Feb 2014 11:56:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E80020149 for ; Mon, 24 Feb 2014 11:56:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A66D20131 for ; Mon, 24 Feb 2014 11:56:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752196AbaBXL4f (ORCPT ); Mon, 24 Feb 2014 06:56:35 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:35797 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751936AbaBXL4e (ORCPT ); Mon, 24 Feb 2014 06:56:34 -0500 Received: by mail-wi0-f179.google.com with SMTP id bs8so2930547wib.12 for ; Mon, 24 Feb 2014 03:56:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=RhZXOq2PayaVkgs8cjI/uMmMAtDqyBPKYOuT2g/OqB4=; b=XhqHTfHKbVKZRXQauB3RIp/zOpPBnaTcAsSO6jy/BBlMpQdtTv7ATH1eDvcNNLhTyC vsm62CXGbYdagiIepTFyJpYjJB3gjApS9gcS8QLoBkQB8YCkqDEZfpx4VmG1zD0Twir7 CbbgFpndc5opB/QOkoPZKMQpc05HPcAsLfnzYE7EXgfPyt9nb9eXVyiEfwZ8J19gfqYE cNvNXWjvrCQqoALVbqfCnpme5Y/m12nhHsVuk2//Z6T7D1WsvoBEg1L/EbYxPMiDz3ul zjViidDsXexfwC8Hmv9f12YVfZ/G9E5KMZOxVQzblUn3L6XBwsk2xsuvb4aJCk9Ef3x9 FKZw== X-Received: by 10.194.104.39 with SMTP id gb7mr18354530wjb.69.1393242992963; Mon, 24 Feb 2014 03:56:32 -0800 (PST) Received: from storm-desktop.lan (bl9-170-181.dsl.telepac.pt. [85.242.170.181]) by mx.google.com with ESMTPSA id r3sm10338101wjw.0.2014.02.24.03.56.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 03:56:32 -0800 (PST) From: Filipe David Borba Manana To: xfs@oss.sgi.com Cc: david@fromorbit.com, linux-btrfs@vger.kernel.org, Filipe David Borba Manana Subject: [PATCH] xfstests: add function _require_fssum() Date: Mon, 24 Feb 2014 11:56:23 +0000 Message-Id: <1393242983-16149-1-git-send-email-fdmanana@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 To avoid repeating detection of fssum presence in many btrfs tests, as suggested by Dave Chinner. Signed-off-by: Filipe David Borba Manana --- common/rc | 7 +++++++ tests/btrfs/007 | 5 +---- tests/btrfs/016 | 5 +---- tests/btrfs/030 | 5 +---- tests/btrfs/038 | 5 +---- tests/btrfs/039 | 5 +---- tests/btrfs/040 | 5 +---- tests/btrfs/041 | 5 +---- tests/btrfs/042 | 5 +---- 9 files changed, 15 insertions(+), 32 deletions(-) mode change 100644 => 100755 tests/btrfs/016 diff --git a/common/rc b/common/rc index 5df504c..cce05cc 100644 --- a/common/rc +++ b/common/rc @@ -2144,6 +2144,13 @@ _require_cp_reflink() _notrun "This test requires a cp with --reflink support." } +_require_fssum() +{ + HERE=`pwd` + FSSUM_PROG=$HERE/src/fssum + [ -x $FSSUM_PROG ] || _notrun "fssum not built" +} + # Given 2 files, verify that they have the same mapping but different # inodes - i.e. an undisturbed reflink # Silent if so, make noise if not diff --git a/tests/btrfs/007 b/tests/btrfs/007 index 5df9ccb..5430613 100755 --- a/tests/btrfs/007 +++ b/tests/btrfs/007 @@ -31,7 +31,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` status=1 @@ -52,11 +51,9 @@ _need_to_be_root _supported_fs btrfs _supported_os Linux _require_scratch +_require_fssum _require_seek_data_hole -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" - rm -f $seqres.full workout() diff --git a/tests/btrfs/016 b/tests/btrfs/016 old mode 100644 new mode 100755 index 6faead1..d04c21a --- a/tests/btrfs/016 +++ b/tests/btrfs/016 @@ -26,7 +26,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` tmp_dir=send_temp_$seq @@ -51,9 +50,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _supported_fs btrfs _supported_os Linux _require_scratch - -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" +_require_fssum _scratch_mkfs > /dev/null 2>&1 diff --git a/tests/btrfs/030 b/tests/btrfs/030 index a9f5fb4..a76a410 100755 --- a/tests/btrfs/030 +++ b/tests/btrfs/030 @@ -36,7 +36,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -54,11 +53,9 @@ _cleanup() _supported_fs btrfs _supported_os Linux _require_scratch +_require_fssum _need_to_be_root -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" - rm -f $seqres.full _scratch_mkfs >/dev/null 2>&1 diff --git a/tests/btrfs/038 b/tests/btrfs/038 index 8893696..4941d3e 100755 --- a/tests/btrfs/038 +++ b/tests/btrfs/038 @@ -32,7 +32,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -50,11 +49,9 @@ _cleanup() _supported_fs btrfs _supported_os Linux _require_scratch +_require_fssum _need_to_be_root -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" - rm -f $seqres.full _scratch_mkfs >/dev/null 2>&1 diff --git a/tests/btrfs/039 b/tests/btrfs/039 index 41e09be..758b23c 100755 --- a/tests/btrfs/039 +++ b/tests/btrfs/039 @@ -35,7 +35,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -53,11 +52,9 @@ _cleanup() _supported_fs btrfs _supported_os Linux _require_scratch +_require_fssum _need_to_be_root -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" - rm -f $seqres.full _scratch_mkfs >/dev/null 2>&1 diff --git a/tests/btrfs/040 b/tests/btrfs/040 index 77c4a84..dfd495c 100755 --- a/tests/btrfs/040 +++ b/tests/btrfs/040 @@ -35,7 +35,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -53,11 +52,9 @@ _cleanup() _supported_fs btrfs _supported_os Linux _require_scratch +_require_fssum _need_to_be_root -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" - rm -f $seqres.full _scratch_mkfs >/dev/null 2>&1 diff --git a/tests/btrfs/041 b/tests/btrfs/041 index bfc0e4b..a960001 100755 --- a/tests/btrfs/041 +++ b/tests/btrfs/041 @@ -31,7 +31,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -49,11 +48,9 @@ _cleanup() _supported_fs btrfs _supported_os Linux _require_scratch +_require_fssum _need_to_be_root -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" - rm -f $seqres.full _scratch_mkfs >/dev/null 2>&1 diff --git a/tests/btrfs/042 b/tests/btrfs/042 index 2bd5147..9aa8967 100755 --- a/tests/btrfs/042 +++ b/tests/btrfs/042 @@ -36,7 +36,6 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -here=`pwd` tmp=`mktemp -d` status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -54,11 +53,9 @@ _cleanup() _supported_fs btrfs _supported_os Linux _require_scratch +_require_fssum _need_to_be_root -FSSUM_PROG=$here/src/fssum -[ -x $FSSUM_PROG ] || _notrun "fssum not built" - rm -f $seqres.full _scratch_mkfs >/dev/null 2>&1