summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-11-18 15:09:50 +0100
committerDavid Sterba <dsterba@suse.com>2016-11-23 10:51:38 +0100
commit7cd40e125b42831f1cda999a5d206739853120fd (patch)
treea56ac6169f460142d46ca42f492d23140d1890f8 /tests
parent9da3ce40f54340d5a660233ae1fb040d724757f8 (diff)
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 <dsterba@suse.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/common8
1 files 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