diff options
-rw-r--r-- | tests/common | 7 | ||||
-rwxr-xr-x | tests/misc-tests/029-send-p-different-mountpoints/test.sh | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/common b/tests/common index fae30f1d..4b266c5b 100644 --- a/tests/common +++ b/tests/common @@ -54,6 +54,13 @@ _log() echo "$*" | tee -a "$RESULTS" } +# copy stdout to log and pass to stdout, eg. another stdout consumer, commands +# should redirect stderr to stdout if this is consmed by further commands +_log_stdout() +{ + tee -a "$RESULTS" +} + _not_run() { echo " [NOTRUN] $*" diff --git a/tests/misc-tests/029-send-p-different-mountpoints/test.sh b/tests/misc-tests/029-send-p-different-mountpoints/test.sh index 64048334..6a380158 100755 --- a/tests/misc-tests/029-send-p-different-mountpoints/test.sh +++ b/tests/misc-tests/029-send-p-different-mountpoints/test.sh @@ -31,7 +31,7 @@ run_check $SUDO_HELPER "$TOP/btrfs" subvolume snapshot -r \ run_mustfail_stdout "send -p on 2 mount points" \ $SUDO_HELPER "$TOP/btrfs" send -f /dev/null -p \ "$SUBVOL_MNT/test-subvol-mnt-subvol" "$TOPLEVEL_MNT/test-subvol-mnt-root" \ - | tee -a "$RESULTS" \ + | _log_stdout \ | grep -q "not on mount point.*/toplevel" \ || _fail "expected output not found, please check the logs" |