Skip to contentSkip to conversation

btrfs-progs: tests: Avoid debug log populating stdout

PATCH In review Qu Wenruo 2 participants 2 messages Jul 24, 2019 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs-progs: tests: Avoid debug log populating stdout

When running misc-test/034, we got unexpected log output:

      [TEST/misc]   033-filename-length-limit
      [TEST/misc]   034-metadata-uuid

Checking btrfstune logic
Checking dump-super output
Checking output after fsid change
Checking for incompat textual representation
Checking setting fsid back to original
Testing btrfs-image restore

This is caused by commit 2570cff076b1 ("btrfs-progs: test: cleanup misc-tests/034") which uses _log facility which also populates stdout.

Just change _log() to echo "$*" >> "$RESULTS" to fix it. Unlike the initial commit, there is no other user of _log, so it shouldn't affect other tests.

---
 tests/common | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/common +1 -1
index 79a16f1e187d..75e5540155cc 100644
@@ -51,7 +51,7 @@ _fail()
 # log a message to the results file
 _log()
 {
-	echo "$*" | tee -a "$RESULTS"
+	echo "$*" >> "$RESULTS"
 }
 
 # copy stdout to log and pass to stdout, eg. another stdout consumer, commands
Signature · 1 line
2.22.0
#1 lore raw
Quoted 10 lines · Qu Wenruo

When running misc-test/034, we got unexpected log output:

      [TEST/misc]   033-filename-length-limit
      [TEST/misc]   034-metadata-uuid

Checking btrfstune logic
Checking dump-super output
Checking output after fsid change
Checking for incompat textual representation
Checking setting fsid back to original
Testing btrfs-image restore

Quoted 8 lines

This is caused by commit 2570cff076b1 ("btrfs-progs: test: cleanup misc-tests/034") which uses _log facility which also populates stdout.

Just change _log() to echo "$*" >> "$RESULTS" to fix it. Unlike the initial commit, there is no other user of _log, so it shouldn't affect other tests.

Applied, thanks. I'll fix up the remaining echo > $RESULTS in tests.