NetBSD Problem Report #49344

From www@NetBSD.org  Fri Oct 31 05:59:19 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id EAA2DA66A3
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 31 Oct 2014 05:59:19 +0000 (UTC)
Message-Id: <20141031055918.CD946A66A9@mollari.NetBSD.org>
Date: Fri, 31 Oct 2014 05:59:18 +0000 (UTC)
From: yaneurabeya@gmail.com
Reply-To: yaneurabeya@gmail.com
To: gnats-bugs@NetBSD.org
Subject: [test] usr.sbin/tcpdump/t_tcpdump.sh:promiscuous is racy and assumes traffic is always generated; can fail on heavily loaded or quiet systems
X-Send-Pr-Version: www-1.0

>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:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.