Skip to content

Commit

Permalink
selftests: netfilter: Avoid hanging ipvs.sh
Browse files Browse the repository at this point in the history
If the client can't reach the server, the latter remains listening
forever. Kill it after 5s of waiting.

Fixes: 867d219 ("selftests: netfilter: add ipvs test script")
Signed-off-by: Phil Sutter <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
Phil Sutter authored and ummakynes committed Sep 26, 2024
1 parent e306e37 commit fc78630
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/net/netfilter/ipvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit fc78630

Please sign in to comment.