]> git.dujemihanovic.xyz Git - linux.git/commitdiff
selftests: netfilter: Avoid hanging ipvs.sh
authorPhil Sutter <phil@nwl.cc>
Thu, 19 Sep 2024 12:40:00 +0000 (14:40 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 26 Sep 2024 11:03:03 +0000 (13:03 +0200)
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>
tools/testing/selftests/net/netfilter/ipvs.sh

index 4ceee9fb39495b41ff155db1c9025dabee1a3bd7..d3edb16cd4b3f6a69297db9699b28a85be229e6e 100755 (executable)
@@ -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
 }