git: a6a864080cfe - main - tests/netinet6: fix ndp_del_gu_success flakiness

From: Olivier Cochard <olivier_at_FreeBSD.org>
Date: Wed, 07 Oct 2026 04:11:17 UTC
The branch main has been updated by olivier:

URL: https://cgit.FreeBSD.org/src/commit/?id=a6a864080cfe2e8308cfae8d07f1affe1a4ac8fa

commit a6a864080cfe2e8308cfae8d07f1affe1a4ac8fa
Author:     Olivier Cochard <olivier@FreeBSD.org>
AuthorDate: 2026-10-07 04:04:16 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2026-10-07 04:07:17 +0000

    tests/netinet6: fix ndp_del_gu_success flakiness
    
    The test pinged an unanswered address and then deleted the resulting
    INCOMPLETE neighbor entry.
    The kernel frees that entry after about 3s, so on a loaded VM,
    ndp -d could run too late and fail with ENOENT.
    
    Configure 2001:db8::2 on epair0b so the ping gets a reply and the
    entry becomes REACHABLE.
    
    Approved by:    pouria
    Sponsored by:   Netflix
    Differential Revision:  https://reviews.freebsd.org/D60348
---
 tests/sys/netinet6/ndp.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh
index 636a5558b7a8..61945ec3c354 100755
--- a/tests/sys/netinet6/ndp.sh
+++ b/tests/sys/netinet6/ndp.sh
@@ -85,17 +85,21 @@ ndp_del_gu_success_body() {
 
 	vnet_mkjail ${jname} ${epair0}a
 
-	jexec ${jname} ndp -i ${epair0}a -- -disabled
-	jexec ${jname} ifconfig ${epair0}a up
+	ndp_if_up ${epair0}a ${jname}
+	ndp_if_up ${epair0}b
 
 	jexec ${jname} ifconfig ${epair0}a inet6 2001:db8::1/64
+	ifconfig ${epair0}b inet6 2001:db8::2/64
 
 	# wait for DAD to complete
-	while [ `jexec ${jname} ifconfig | grep inet6 | grep -c tentative` != "0" ]; do
+	while jexec ${jname} ifconfig ${epair0}a inet6 | grep -q tentative ||
+	    ifconfig ${epair0}b inet6 | grep -q tentative; do
 		sleep 0.1
 	done
 
-	jexec ${jname} ping -c1 -t1 2001:db8::2
+	# A reachable peer keeps the entry alive; an unanswered solicitation
+	# would expire it after nd6_mmaxtries retransmissions (about 3s).
+	atf_check -o ignore jexec ${jname} ping -c1 -t5 2001:db8::2
 
 	atf_check -o match:"2001:db8::2 \(2001:db8::2\) deleted" jexec ${jname} ndp -nd 2001:db8::2
 }