btrfs-progs: tests: add helper to log pipe stdout
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ea0956bb2a
commit
510bb4ccc4
|
@ -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] $*"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue