From patchwork Tue Feb 21 08:34:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9584039 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 9F415600CA for ; Tue, 21 Feb 2017 08:35:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89E24288E0 for ; Tue, 21 Feb 2017 08:35:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EFE0288E4; Tue, 21 Feb 2017 08:35:15 +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 DE08C288E0 for ; Tue, 21 Feb 2017 08:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751056AbdBUIfM (ORCPT ); Tue, 21 Feb 2017 03:35:12 -0500 Received: from cn.fujitsu.com ([59.151.112.132]:12298 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751505AbdBUIfG (ORCPT ); Tue, 21 Feb 2017 03:35:06 -0500 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="15798792" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 21 Feb 2017 16:34:49 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id E699E47C4E8D for ; Tue, 21 Feb 2017 16:34:47 +0800 (CST) Received: from localhost.localdomain (10.167.226.34) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 21 Feb 2017 16:34:45 +0800 From: Qu Wenruo To: CC: Lu Fengqi Subject: [PATCH v3 11/12] btrfs-progs: fsck: Fix lowmem mode override to allow it skip repair work Date: Tue, 21 Feb 2017 16:34:37 +0800 Message-ID: <20170221083438.25719-12-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20170221083438.25719-1-quwenruo@cn.fujitsu.com> References: <20170221083438.25719-1-quwenruo@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.34] X-yoursite-MailScanner-ID: E699E47C4E8D.A26D0 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lu Fengqi Current common.local doesn't handle lowmem mode well. It passes "--mode=lowmem" alone with "--repair", making it unable to check lowmem mode. It's caused by the following bugs: 1) Wrong variable in test/common.local We should check TEST_ARGS_CHECK, not TEST_CHECK, which is not defined so we never return 1. 2) Wrong parameter passed to _cmd_spec() in test/common This prevents us from grepping the correct parameters. Fix it. Signed-off-by: Lu Fengqi --- tests/common | 8 ++++---- tests/common.local | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/common b/tests/common index 51c2e267..7ad436e3 100644 --- a/tests/common +++ b/tests/common @@ -106,7 +106,7 @@ run_check() ins=$(_get_spec_ins "$@") spec=$(($ins-1)) cmd=$(eval echo "\${$spec}") - spec=$(_cmd_spec "$cmd") + spec=$(_cmd_spec "${@:$spec}") set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}" echo "############### $@" >> "$RESULTS" 2>&1 if [[ $TEST_LOG =~ tty ]]; then echo "CMD: $@" > /dev/tty; fi @@ -128,7 +128,7 @@ run_check_stdout() ins=$(_get_spec_ins "$@") spec=$(($ins-1)) cmd=$(eval echo "\${$spec}") - spec=$(_cmd_spec "$cmd") + spec=$(_cmd_spec "${@:$spec}") set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}" echo "############### $@" >> "$RESULTS" 2>&1 if [[ $TEST_LOG =~ tty ]]; then echo "CMD(stdout): $@" > /dev/tty; fi @@ -152,7 +152,7 @@ run_mayfail() ins=$(_get_spec_ins "$@") spec=$(($ins-1)) cmd=$(eval echo "\${$spec}") - spec=$(_cmd_spec "$cmd") + spec=$(_cmd_spec "${@:$spec}") set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}" echo "############### $@" >> "$RESULTS" 2>&1 if [[ $TEST_LOG =~ tty ]]; then echo "CMD(mayfail): $@" > /dev/tty; fi @@ -188,7 +188,7 @@ run_mustfail() ins=$(_get_spec_ins "$@") spec=$(($ins-1)) cmd=$(eval echo "\${$spec}") - spec=$(_cmd_spec "$cmd") + spec=$(_cmd_spec "${@:$spec}") set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}" echo "############### $@" >> "$RESULTS" 2>&1 if [[ $TEST_LOG =~ tty ]]; then echo "CMD(mustfail): $@" > /dev/tty; fi diff --git a/tests/common.local b/tests/common.local index 9f567c27..4f56bb08 100644 --- a/tests/common.local +++ b/tests/common.local @@ -17,7 +17,7 @@ TEST_ARGS_CHECK=--mode=lowmem # break tests _skip_spec() { - if echo "$TEST_CHECK" | grep -q 'mode=lowmem' && + if echo "$TEST_ARGS_CHECK" | grep -q 'mode=lowmem' && echo "$@" | grep -q -- '--repair'; then return 0 fi