mirror of
https://github.com/kdave/btrfs-progs
synced 2025-03-08 03:37:54 +00:00
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 <lufq.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
cbaa289d3d
commit
a0e44021ab
@ -106,7 +106,7 @@ run_check()
|
|||||||
ins=$(_get_spec_ins "$@")
|
ins=$(_get_spec_ins "$@")
|
||||||
spec=$(($ins-1))
|
spec=$(($ins-1))
|
||||||
cmd=$(eval echo "\${$spec}")
|
cmd=$(eval echo "\${$spec}")
|
||||||
spec=$(_cmd_spec "$cmd")
|
spec=$(_cmd_spec "${@:$spec}")
|
||||||
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
||||||
echo "############### $@" >> "$RESULTS" 2>&1
|
echo "############### $@" >> "$RESULTS" 2>&1
|
||||||
if [[ $TEST_LOG =~ tty ]]; then echo "CMD: $@" > /dev/tty; fi
|
if [[ $TEST_LOG =~ tty ]]; then echo "CMD: $@" > /dev/tty; fi
|
||||||
@ -128,7 +128,7 @@ run_check_stdout()
|
|||||||
ins=$(_get_spec_ins "$@")
|
ins=$(_get_spec_ins "$@")
|
||||||
spec=$(($ins-1))
|
spec=$(($ins-1))
|
||||||
cmd=$(eval echo "\${$spec}")
|
cmd=$(eval echo "\${$spec}")
|
||||||
spec=$(_cmd_spec "$cmd")
|
spec=$(_cmd_spec "${@:$spec}")
|
||||||
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
||||||
echo "############### $@" >> "$RESULTS" 2>&1
|
echo "############### $@" >> "$RESULTS" 2>&1
|
||||||
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(stdout): $@" > /dev/tty; fi
|
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(stdout): $@" > /dev/tty; fi
|
||||||
@ -152,7 +152,7 @@ run_mayfail()
|
|||||||
ins=$(_get_spec_ins "$@")
|
ins=$(_get_spec_ins "$@")
|
||||||
spec=$(($ins-1))
|
spec=$(($ins-1))
|
||||||
cmd=$(eval echo "\${$spec}")
|
cmd=$(eval echo "\${$spec}")
|
||||||
spec=$(_cmd_spec "$cmd")
|
spec=$(_cmd_spec "${@:$spec}")
|
||||||
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
||||||
echo "############### $@" >> "$RESULTS" 2>&1
|
echo "############### $@" >> "$RESULTS" 2>&1
|
||||||
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(mayfail): $@" > /dev/tty; fi
|
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(mayfail): $@" > /dev/tty; fi
|
||||||
@ -188,7 +188,7 @@ run_mustfail()
|
|||||||
ins=$(_get_spec_ins "$@")
|
ins=$(_get_spec_ins "$@")
|
||||||
spec=$(($ins-1))
|
spec=$(($ins-1))
|
||||||
cmd=$(eval echo "\${$spec}")
|
cmd=$(eval echo "\${$spec}")
|
||||||
spec=$(_cmd_spec "$cmd")
|
spec=$(_cmd_spec "${@:$spec}")
|
||||||
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
set -- "${@:1:$(($ins-1))}" $spec "${@: $ins}"
|
||||||
echo "############### $@" >> "$RESULTS" 2>&1
|
echo "############### $@" >> "$RESULTS" 2>&1
|
||||||
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(mustfail): $@" > /dev/tty; fi
|
if [[ $TEST_LOG =~ tty ]]; then echo "CMD(mustfail): $@" > /dev/tty; fi
|
||||||
|
@ -17,7 +17,7 @@ TEST_ARGS_CHECK=--mode=lowmem
|
|||||||
# break tests
|
# break tests
|
||||||
_skip_spec()
|
_skip_spec()
|
||||||
{
|
{
|
||||||
if echo "$TEST_CHECK" | grep -q 'mode=lowmem' &&
|
if echo "$TEST_ARGS_CHECK" | grep -q 'mode=lowmem' &&
|
||||||
echo "$@" | grep -q -- '--repair'; then
|
echo "$@" | grep -q -- '--repair'; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user