Skip to content

Commit a179759

Browse files
amorenozkuba-moo
authored andcommitted
selftests: openvswitch: fix tcpdump execution
Fix the way tcpdump is executed by: - Using the right variable for the namespace. Currently the use of the empty "ns" makes the command fail. - Waiting until it starts to capture to ensure the interesting traffic is caught on slow systems. - Using line-buffered output to ensure logs are available when the test is paused with "-p". Otherwise the last chunk of data might only be written when tcpdump is killed. Fixes: 74cc26f ("selftests: openvswitch: add interface support") Signed-off-by: Adrian Moreno <[email protected]> Acked-by: Eelco Chaudron <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent dbfca16 commit a179759

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/testing/selftests/net/openvswitch/openvswitch.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ ovs_add_netns_and_veths () {
171171
ovs_add_if "$1" "$2" "$4" -u || return 1
172172
fi
173173

174-
[ $TRACING -eq 1 ] && ovs_netns_spawn_daemon "$1" "$ns" \
175-
tcpdump -i any -s 65535
174+
if [ $TRACING -eq 1 ]; then
175+
ovs_netns_spawn_daemon "$1" "$3" tcpdump -l -i any -s 6553
176+
ovs_wait grep -q "listening on any" ${ovs_dir}/stderr
177+
fi
176178

177179
return 0
178180
}

0 commit comments

Comments
 (0)