All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
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	[thread overview]
Message-ID: <20170221083438.25719-12-quwenruo@cn.fujitsu.com> (raw)
In-Reply-To: <20170221083438.25719-1-quwenruo@cn.fujitsu.com>

From: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

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 <lufq.fnst@cn.fujitsu.com>
---
 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
-- 
2.11.1




  parent reply	other threads:[~2017-02-21  8:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21  8:34 [PATCH v3 00/12] lowmem mode fixes Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 01/12] btrfs-progs: lowmem check: Fix several bugs related to afterward search Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 02/12] btrfs-progs: check: Output verbose error when fsck found a bug in any tree Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 03/12] btrfs-progs: lowmem check: Fix false alert in checking data extent csums Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 04/12] btrfs-progs: lowmem check: Fix extent item size false alert Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 05/12] btrfs-progs: lowmem check: Fix false alert on inline compressed extent Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 06/12] btrfs-progs: lowmem check: Fix silent error if first inode item missing Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 07/12] btrfs-progs: tests: Move fsck-tests/015 to fuzz tests Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 08/12] btrfs-progs: fsck-test: Add test image for lowmem mode block group false alert Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 09/12] btrfs-progs: fsck-test: Make 013 compatible with lowmem mode Qu Wenruo
2017-02-21  8:34 ` [PATCH v3 10/12] btrfs-progs: fsck-test: Add new test case for file extent false alerts Qu Wenruo
2017-03-01 16:27   ` David Sterba
2017-02-21  8:34 ` Qu Wenruo [this message]
2017-02-21  8:34 ` [PATCH v3 12/12] btrfs-progs: cmds-check.c: walk_down_tree_v2 break cause of leaf process Qu Wenruo
2017-03-01 16:30 ` [PATCH v3 00/12] lowmem mode fixes David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170221083438.25719-12-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lufq.fnst@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.