tests: skip old socat silently
I've seen enough logs with verbose socat output for now. Let's make it quiet. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This commit is contained in:
parent
58c87bd045
commit
e486622991
|
@ -699,22 +699,23 @@ function ts_init_socket_to_file {
|
||||||
ts_check_prog "socat"
|
ts_check_prog "socat"
|
||||||
rm -f "$socket" "$outfile"
|
rm -f "$socket" "$outfile"
|
||||||
|
|
||||||
|
# if socat is too old for these options we'll skip it below
|
||||||
socat -u UNIX-LISTEN:$socket,fork,max-children=1,backlog=128 \
|
socat -u UNIX-LISTEN:$socket,fork,max-children=1,backlog=128 \
|
||||||
STDOUT > "$outfile" &
|
STDOUT > "$outfile" 2>/dev/null &
|
||||||
pid=$!
|
pid=$!
|
||||||
|
|
||||||
# check for running background process
|
# check for running background process
|
||||||
if [ "$pid" -le "0" ] || ! kill -s 0 "$pid"; then
|
if [ "$pid" -le "0" ] || ! kill -s 0 "$pid" &>/dev/null; then
|
||||||
ts_skip "unable to run socat"
|
ts_skip "unable to run socat"
|
||||||
fi
|
fi
|
||||||
# wait for the socket listener
|
# wait for the socket listener
|
||||||
if ! socat -u /dev/null UNIX-CONNECT:$socket,retry=30,interval=0.1; then
|
if ! socat -u /dev/null UNIX-CONNECT:$socket,retry=30,interval=0.1 &>/dev/null; then
|
||||||
kill -9 "$pid"
|
kill -9 "$pid" &>/dev/null
|
||||||
ts_skip "timeout waiting for socket"
|
ts_skip "timeout waiting for socat socket"
|
||||||
fi
|
fi
|
||||||
# check socket again
|
# check socket again
|
||||||
if ! socat -u /dev/null UNIX-CONNECT:$socket; then
|
if ! socat -u /dev/null UNIX-CONNECT:$socket &>/dev/null; then
|
||||||
kill -9 "$pid"
|
kill -9 "$pid" &>/dev/null
|
||||||
ts_skip "socket stopped listening"
|
ts_skip "socat socket stopped listening"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue