From patchwork Thu May 1 23:16:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darrick Wong X-Patchwork-Id: 344862 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 4CCCC14010A for ; Fri, 2 May 2014 09:16:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752633AbaEAXQV (ORCPT ); Thu, 1 May 2014 19:16:21 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:29180 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbaEAXQV (ORCPT ); Thu, 1 May 2014 19:16:21 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s41NGJde025203 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 May 2014 23:16:20 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s41NGIuh007418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 May 2014 23:16:19 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s41NGIts014516; Thu, 1 May 2014 23:16:18 GMT Received: from localhost (/10.145.179.157) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 01 May 2014 16:16:18 -0700 Subject: [PATCH 35/37] tests: enable using fuse2fs with metadata checksum test From: "Darrick J. Wong" To: tytso@mit.edu, darrick.wong@oracle.com Cc: linux-ext4@vger.kernel.org Date: Thu, 01 May 2014 16:16:16 -0700 Message-ID: <20140501231616.31890.76143.stgit@birch.djwong.org> In-Reply-To: <20140501231222.31890.82860.stgit@birch.djwong.org> References: <20140501231222.31890.82860.stgit@birch.djwong.org> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Create custom mount/umount commands so that we can run the metadata checksumming tests against fuse2fs. Signed-off-by: Darrick J. Wong --- tests/fuse2fs/mount | 28 ++++++++++++++++++++++++++++ tests/fuse2fs/umount | 21 +++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 tests/fuse2fs/mount create mode 100755 tests/fuse2fs/umount -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" 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/fuse2fs/mount b/tests/fuse2fs/mount new file mode 100755 index 0000000..321b1f5 --- /dev/null +++ b/tests/fuse2fs/mount @@ -0,0 +1,28 @@ +#!/bin/bash + +# Mount ext4 via fuse. Put tests/fuse2fs/ at the start of PATH if you want +# to run the metadata checksumming tests with fuse2fs. + +for arg in "$@"; do + if [ -b "${arg}" ]; then + DEV="${arg}" + elif [ -d "${arg}" ]; then + MNT="${arg}" + fi +done + +if [ -z "${DEV}" -o -z "${MNT}" ]; then + echo "Please specify a device and a mountpoint." +fi + +DIR="$(readlink -f "$(dirname "$0")")" +if [ -n "${FUSE2FS_DEBUG}" ]; then + "${DIR}/../../misc/fuse2fs" "${DEV}" "${MNT}" -d >> "${FUSE2FS_DEBUG}" 2>&1 & + sleep 1 + exit 0 +else + "${DIR}/../../misc/fuse2fs" "${DEV}" "${MNT}" + ERR=$? + sleep 1 + exit "${ERR}" +fi diff --git a/tests/fuse2fs/umount b/tests/fuse2fs/umount new file mode 100755 index 0000000..b21ee5a --- /dev/null +++ b/tests/fuse2fs/umount @@ -0,0 +1,21 @@ +#!/bin/bash + +# unmount a filesystem +sync +sync +sync + +sleep 2 +if [ -x /bin/umount ]; then + /bin/umount "$@" + ERR=$? +elif [ -x /sbin/umount ]; then + /sbin/umount "$@" + ERR=$? +else + echo "Where is umount?" + exit 5 +fi +sleep 1 + +exit "${ERR}"