Signed-off-by: David Sterba <dsterba@suse.com>
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] $*"
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"