NetBSD-Bugs archive

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

Re: misc/58568: t_tcpdump leaves garbage in /tmp



The following reply was made to PR misc/58568; it has been noted by GNATS.

From: Attaullah <mdattaullahansari152%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: misc/58568: t_tcpdump leaves garbage in /tmp
Date: Wed, 5 Mar 2025 01:32:08 +0530

 The test's purpose is to toggle promiscuous mode via tcpdump -c 1,
 which directly invokes the ioctl(SIOCSIFFLAGS) kernel interface. Using
 atf-check to run tcpdump in the background with the '-s/-o/-e ignore'
 flags made it behave like direct execution while leaking
 /tmp/check.XXXXXX directories when terminated. Replacing it with
 direct execution should not alter the test's behavior.
 
 diff --git a/tests/usr.sbin/tcpdump/t_tcpdump.sh
 b/tests/usr.sbin/tcpdump/t_tcpdump.sh
 index 5cd89b41abe4..38e4edc8a4fb 100644
 --- a/tests/usr.sbin/tcpdump/t_tcpdump.sh
 +++ b/tests/usr.sbin/tcpdump/t_tcpdump.sh
 @@ -28,8 +28,11 @@
  # POSSIBILITY OF SUCH DAMAGE.
  #
  prom() {
 -    atf_check -s ignore -o ignore -e ignore -x "tcpdump -c 1 -i $1" &
 -    sleep 2; kill $! >/dev/null 2>&1
 +    tcpdump -c 1 -i "$1" >/dev/null 2>&1 &
 +    pid=$!
 +    sleep 2
 +    kill "$pid" 2>/dev/null || :
 +    wait "$pid" 2>/dev/null || :
  }
 
  atf_test_case promiscuous
 


Home | Main Index | Thread Index | Old Index