selftests: netfilter: Avoid hanging ipvs.sh
Subsystems (3)
Phil Sutter
reviewerPATCH 1/1 selftests: netfilter: Avoid hanging ipvs.sh
If the client can't reach the server, the latter remains listening forever. Kill it after 3s of waiting.
--- tools/testing/selftests/net/netfilter/ipvs.sh | 4 ++++ 1 file changed, 4 insertions(+)
tools/testing/selftests/net/netfilter/ipvs.sh +4 -0
@@ -107,6 +107,10 @@ client_connect() { } verify_data() { + waitpid -t 3 "${server_pid}" + if [ $? -eq 3 ]; then + kill "${server_pid}" + fi wait "${server_pid}" cmp "$infile" "$outfile" 2>/dev/null }
Signature · 1 line
2.43.0
Quoted 2 lines · Phil Sutter
If the client can't reach the server, the latter remains listening forever. Kill it after 3s of waiting.
Applied to nf.git, thanks
Pablo Neira Ayuso
maintainerQuoted 5 lines · Pablo Neira Ayuso
Quoted 2 lines · Phil Sutter
If the client can't reach the server, the latter remains listening forever. Kill it after 3s of waiting.
Applied to nf.git, thanks
Too fast. One of my test machine has not waitpid, there is no usage of waitpid in other existing selftest scripts?
What am I missing here? :)
Phil Sutter
reviewerQuoted 9 lines · Pablo Neira Ayuso
Quoted 5 lines · Pablo Neira Ayuso
Quoted 2 lines · Phil Sutter
If the client can't reach the server, the latter remains listening forever. Kill it after 3s of waiting.
Applied to nf.git, thanks
Too fast. One of my test machine has not waitpid, there is no usage of waitpid in other existing selftest scripts?
Yeah, I only see "wait" being used in other scripts which is a bash-builtin. I needed waitpid for its timeout option.
Quoted 1 line
What am I missing here? :)
My v2 which uses 'timeout' command as used for the client already. :)
Cheers, Phil