From a0e44021abd7fa612f3060d6b9fe7a50211aafcf Mon Sep 17 00:00:00 2001 From: Lu Fengqi Date: Tue, 21 Feb 2017 16:34:37 +0800 Subject: [PATCH] btrfs-progs: check: Fix lowmem mode override to allow it skip repair work 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 Signed-off-by: David Sterba --- 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.4.GIT