summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
diff options
context:
space:
mode:
authorRuediger Meier2016-03-09 18:15:25 +0100
committerRuediger Meier2016-03-13 21:47:32 +0100
commite4866229911a93c61c2d554ea67e010d01dd64e1 (patch)
tree0e63e16636d1009ab9d7b66790fc2c877ed5dc95 /tests/functions.sh
parentmisc: fix icc/clang compiler warnings (diff)
downloadkernel-qcow2-util-linux-e4866229911a93c61c2d554ea67e010d01dd64e1.tar.gz
kernel-qcow2-util-linux-e4866229911a93c61c2d554ea67e010d01dd64e1.tar.xz
kernel-qcow2-util-linux-e4866229911a93c61c2d554ea67e010d01dd64e1.zip
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>
Diffstat (limited to 'tests/functions.sh')
-rw-r--r--tests/functions.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index 74622b068..5246605e0 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -699,22 +699,23 @@ function ts_init_socket_to_file {
ts_check_prog "socat"
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 \
- STDOUT > "$outfile" &
+ STDOUT > "$outfile" 2>/dev/null &
pid=$!
# 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"
fi
# wait for the socket listener
- if ! socat -u /dev/null UNIX-CONNECT:$socket,retry=30,interval=0.1; then
- kill -9 "$pid"
- ts_skip "timeout waiting for socket"
+ if ! socat -u /dev/null UNIX-CONNECT:$socket,retry=30,interval=0.1 &>/dev/null; then
+ kill -9 "$pid" &>/dev/null
+ ts_skip "timeout waiting for socat socket"
fi
# check socket again
- if ! socat -u /dev/null UNIX-CONNECT:$socket; then
- kill -9 "$pid"
- ts_skip "socket stopped listening"
+ if ! socat -u /dev/null UNIX-CONNECT:$socket &>/dev/null; then
+ kill -9 "$pid" &>/dev/null
+ ts_skip "socat socket stopped listening"
fi
}