From 4203f7c88d5f17dc10075d371ca97aa6359ba71b Mon Sep 17 00:00:00 2001 From: Kirill Isakov Date: Sun, 15 Aug 2021 00:58:55 +0600 Subject: [PATCH] Improve failure detection in the test suite. --- .builds/freebsd.yml | 1 + test/compression.test | 12 ++++++------ test/testlib.sh.in | 20 +++++--------------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index 26829ccf..a52803b2 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -1,6 +1,7 @@ image: freebsd/13.x packages: + - coreutils - autotools - openssl - lzo2 diff --git a/test/compression.test b/test/compression.test index 7c69c2ca..f0952a4f 100755 --- a/test/compression.test +++ b/test/compression.test @@ -106,13 +106,13 @@ for level in $levels; do wait_script foo hosts/bar-up wait_script bar hosts/foo-up - ip netns exec foo \ - socat -u TCP4-LISTEN:$recv_port_foo,reuseaddr OPEN:"$tmp_file",creat & - - ip netns exec bar \ - socat -u OPEN:"$ref_file" TCP4:$ip_foo:$recv_port_foo,retry=30 & + try_limit_time 60 sh </dev/null; then - if is_busybox; then - # busybox does not support --foreground - try_limit_time() { - time=$1 - shift - timeout "$time" "$@" - } - else - # BSD and GNU timeout do not require special handling - try_limit_time() { - time=$1 - shift - timeout --foreground "$time" "$@" - } - fi + try_limit_time() { + time=$1 + shift + timeout "$time" "$@" + } else try_limit_time() { echo >&2 "timeout was not found, running without time limits!" -- 2.20.1