From patchwork Mon Aug 31 05:04:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhaolei X-Patchwork-Id: 7098441 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2A5B09F32B for ; Mon, 31 Aug 2015 05:09:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C26A20878 for ; Mon, 31 Aug 2015 05:09:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B44120872 for ; Mon, 31 Aug 2015 05:08:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869AbbHaFGc (ORCPT ); Mon, 31 Aug 2015 01:06:32 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:53026 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750934AbbHaFGY (ORCPT ); Mon, 31 Aug 2015 01:06:24 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100182455" Received: from bogon (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 31 Aug 2015 13:09:25 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t7V56AMe020009 for ; Mon, 31 Aug 2015 13:06:10 +0800 Received: from localhost.localdomain (10.167.226.114) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.181.6; Mon, 31 Aug 2015 13:06:18 +0800 From: Zhao Lei To: CC: Zhao Lei Subject: [PATCH v2 3/4] btrfs-progs: tests: umount TEST_MNT in clean-tests.sh Date: Mon, 31 Aug 2015 13:04:38 +0800 Message-ID: X-Mailer: git-send-email 1.8.5.1 In-Reply-To: References: MIME-Version: 1.0 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 If a testcase failed, we can't run it(or other tests needs mount) again, # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: fail test failed for case 007-subvolume-sync # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: mount /root/btrfs-progs/tests/test.img /root/btrfs-progs/tests/mnt test failed for case 007-subvolume-sync # This patch add "umount $TEST_MNT" to clean-tests.sh, to let user clean mountpoint easily. After patch: # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: fail test failed for case 007-subvolume-sync # # clean-tests.sh # # ./misc-tests.sh 007 [TEST] 007-subvolume-sync failed: fail test failed for case 007-subvolume-sync # Changelog v1->v2: Put umount command to clean-tests.sh instead of in testscript, to keep failed-test stat until user run clean-tests.sh explicitly, Suggested-by: David Sterba Suggested-by: David Sterba Signed-off-by: Zhao Lei --- tests/clean-tests.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/clean-tests.sh b/tests/clean-tests.sh index c1dc56a..19d682d 100755 --- a/tests/clean-tests.sh +++ b/tests/clean-tests.sh @@ -1,12 +1,15 @@ #!/bin/sh # remove all intermediate files from tests +SCRIPT_DIR=$(dirname $(readlink -f $0)) +TOP=$(readlink -f $SCRIPT_DIR/../) +source $TOP/tests/common + if [ "$BUILD_VERBOSE" = 1 ]; then verbose=-print fi -SCRIPT_DIR=$(dirname $(readlink -f $0)) -TOP=$(readlink -f $SCRIPT_DIR/../) +umount "$TEST_MNT" &>/dev/null if ! cd $TOP/tests; then echo "ERROR: cannot cd to $TOP/tests"