git: 78cb8d7f2991 - stable/12 - netinet tests: delete an interface with pending lookups

Kristof Provost kp at FreeBSD.org
Tue Aug 24 12:53:43 UTC 2021


The branch stable/12 has been updated by kp:

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

commit 78cb8d7f2991498177a7c40dee502cddd4dd5e1c
Author:     Kristof Provost <kp at FreeBSD.org>
AuthorDate: 2021-08-17 14:19:29 +0000
Commit:     Kristof Provost <kp at FreeBSD.org>
CommitDate: 2021-08-24 07:03:15 +0000

    netinet tests: delete an interface with pending lookups
    
    This has been known to trigger panics. It currently doesn't, but we may
    as well have a test for it.
    
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit e86469075c5e391cc86e5bcd4f252712a69de37e)
---
 tests/sys/netinet/arp.sh | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/tests/sys/netinet/arp.sh b/tests/sys/netinet/arp.sh
index 8b5b30911314..b909b9a48fb3 100755
--- a/tests/sys/netinet/arp.sh
+++ b/tests/sys/netinet/arp.sh
@@ -85,12 +85,48 @@ arp_del_success_cleanup() {
 	vnet_cleanup
 }
 
+atf_test_case "pending_delete_if" "cleanup"
+pending_delete_if_head() {
+	atf_set descr 'Test having pending link layer lookups on interface delete'
+	atf_set require.user root
+}
+
+pending_delete_if_body() {
+	vnet_init
+
+	jname="arp_pending_delete_if"
+	epair=$(vnet_mkepair)
+
+	ifconfig ${epair}b up
+
+	vnet_mkjail ${jname} ${epair}a
+	jexec ${jname} ifconfig ${epair}a 198.51.100.1/24
+	for i in `seq 2 200`
+	do
+		jexec ${jname} ping 198.51.100.${i} &
+	done
+
+	# Give the ping processes time to send their ARP requests
+	sleep 1
+
+	jexec ${jname} arp -an
+	jexec ${jname} killall ping
+
+	# Delete the interface. Test failure panics the machine.
+	ifconfig ${epair}b destroy
+}
+
+pending_delete_if_cleanup() {
+	vnet_cleanup
+}
+
 
 atf_init_test_cases()
 {
 
 	atf_add_test_case "arp_add_success"
 	atf_add_test_case "arp_del_success"
+	atf_add_test_case "pending_delete_if"
 }
 
 # end


More information about the dev-commits-src-all mailing list