From 7cd40e125b42831f1cda999a5d206739853120fd Mon Sep 17 00:00:00 2001 From: David Sterba Date: Fri, 18 Nov 2016 15:09:50 +0100 Subject: btrfs-progs: tests: check for TEST_LOG values by a regex The set of possible values will be extended so check for existence of the keyword. Signed-off-by: David Sterba --- tests/common | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/common b/tests/common index c61962da..e653d4c6 100644 --- a/tests/common +++ b/tests/common @@ -42,7 +42,7 @@ _not_run() run_check() { echo "############### $@" >> "$RESULTS" 2>&1 - if [ "$TEST_LOG" = 'tty' ]; then echo "CMD: $@" > /dev/tty; fi + if [[ $TEST_LOG =~ tty ]]; then echo "CMD: $@" > /dev/tty; fi if [ "$1" = 'root_helper' ]; then "$@" >> "$RESULTS" 2>&1 || _fail "failed: $@" else @@ -55,7 +55,7 @@ run_check() run_check_stdout() { 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 if [ "$1" = 'root_helper' ]; then "$@" 2>&1 | tee -a "$RESULTS" || _fail "failed: $@" else @@ -71,7 +71,7 @@ run_mayfail() local ret 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 if [ "$1" = 'root_helper' ]; then "$@" >> $RESULTS 2>&1 else @@ -99,7 +99,7 @@ run_mustfail() shift 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 if [ "$1" = 'root_helper' ]; then "$@" >> "$RESULTS" 2>&1 else -- cgit v1.2.3