]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
selftests: openvswitch: fix tcpdump execution
authorAdrian Moreno <amorenoz@redhat.com>
Tue, 17 Dec 2024 21:16:51 +0000 (22:16 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Dec 2024 03:18:41 +0000 (19:18 -0800)
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: 74cc26f416b9 ("selftests: openvswitch: add interface support")
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Link: https://patch.msgid.link/20241217211652.483016-1-amorenoz@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/openvswitch/openvswitch.sh

index cc0bfae2bafa1b96db67027f9707cfff3d8fbf19..960e1ab4dd04b15300e1699ff50dc40fa6aaa23a 100755 (executable)
@@ -171,8 +171,10 @@ ovs_add_netns_and_veths () {
                ovs_add_if "$1" "$2" "$4" -u || return 1
        fi
 
-       [ $TRACING -eq 1 ] && ovs_netns_spawn_daemon "$1" "$ns" \
-                       tcpdump -i any -s 65535
+       if [ $TRACING -eq 1 ]; then
+               ovs_netns_spawn_daemon "$1" "$3" tcpdump -l -i any -s 6553
+               ovs_wait grep -q "listening on any" ${ovs_dir}/stderr
+       fi
 
        return 0
 }