summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-09-19 14:40:00 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-09-26 13:03:03 +0200
commitfc786304ad9803e8bb86b8599bc64d1c1746c75f (patch)
tree784ffd8095a08139947252f6de15d1e8f136c21d /tools
parente306e3739d9a35c89176281f9ff6c600fcc859a4 (diff)
selftests: netfilter: Avoid hanging ipvs.sh
If the client can't reach the server, the latter remains listening forever. Kill it after 5s of waiting. Fixes: 867d2190799a ("selftests: netfilter: add ipvs test script") Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/netfilter/ipvs.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/netfilter/ipvs.sh b/tools/testing/selftests/net/netfilter/ipvs.sh
index 4ceee9fb3949..d3edb16cd4b3 100755
--- a/tools/testing/selftests/net/netfilter/ipvs.sh
+++ b/tools/testing/selftests/net/netfilter/ipvs.sh
@@ -97,7 +97,7 @@ cleanup() {
}
server_listen() {
- ip netns exec "$ns2" socat -u -4 TCP-LISTEN:8080,reuseaddr STDOUT > "${outfile}" &
+ ip netns exec "$ns2" timeout 5 socat -u -4 TCP-LISTEN:8080,reuseaddr STDOUT > "${outfile}" &
server_pid=$!
sleep 0.2
}