NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/49344: [test] usr.sbin/tcpdump/t_tcpdump.sh:promiscuous is racy and assumes traffic is always generated; can fail on heavily loaded or quiet systems



>Number:         49344
>Category:       misc
>Synopsis:       [test] usr.sbin/tcpdump/t_tcpdump.sh:promiscuous is racy and assumes traffic is always generated; can fail on heavily loaded or quiet systems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 31 06:00:00 +0000 2014
>Originator:     Garrett Cooper
>Release:        n/a
>Organization:
EMC / Isilon Storage Division
>Environment:
n/a
>Description:
We've been running this test script on FreeBSD for some time, and it's worked reasonably well, but has been timing out lately. I took a look at the test script and there are two issues with it:

1. The prom() function is racy. It doesn't work with our heavily loaded VMware workstation VMs not running virtio, and works by accident. Changing prom() from this:

prom() {
        atf_check -s ignore -o ignore -e ignore -x "tcpdump -c 1 -i $1" &
        sleep 2; kill $! >/dev/null 2>&1
}

to this:

prom() {
        tcpdump -c 1 -i $1 &
        tcpdump_pid=$!
        atf_check -e ignore -o ignore -s exit:0 kill -0 $tcpdump_pid
        sleep 10
        atf_check -e ignore -o ignore -s not-exit:0 kill $tcpdump_pid
}

fixed all of the issues we had with timing.

2. The test will function if traffic is being generated on the test host. However, if no traffic is being generated on the interface under test, the test will fail. A multicast packet/datagram generator should be run in the background to ensure that messages are sent via all tested interfaces on the network.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index