Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157886547
D56609.id176297.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D56609.id176297.diff
View Options
diff --git a/tests/sys/netgraph/Makefile b/tests/sys/netgraph/Makefile
--- a/tests/sys/netgraph/Makefile
+++ b/tests/sys/netgraph/Makefile
@@ -17,6 +17,8 @@
socket \
vlan_rotate \
+ATF_TESTS_SH+= eiface_test
+
SRCS.basic= basic.c util.c
SRCS.bridge= bridge.c util.c
SRCS.hub= hub.c util.c
diff --git a/tests/sys/netgraph/eiface_test.sh b/tests/sys/netgraph/eiface_test.sh
new file mode 100644
--- /dev/null
+++ b/tests/sys/netgraph/eiface_test.sh
@@ -0,0 +1,71 @@
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2026 Zhenlei Huang <zlei@FreeBSD.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+atf_test_case "pr292993" "cleanup"
+pr292993_head()
+{
+ atf_set descr 'Test for PR 292993'
+ atf_set require.user root
+ atf_set require.kmods if_epair ng_bridge ng_eiface ng_ether ng_socket
+}
+
+pr292993_body()
+{
+ epair=$(ifconfig epair create)
+ br="${epair}_br0"
+
+ atf_check -s exit:0 -o ignore \
+ ngctl mkpeer ${epair}: bridge lower link0
+ atf_check -s exit:0 -o ignore \
+ ngctl name ${epair}:lower $br
+
+ for i in `seq 1 10`
+ do
+ atf_check -s exit:0 -o ignore \
+ ngctl mkpeer $br: eiface link$i ether
+ ngeth=$(ngctl msg $br:link$i getifname | awk '$1 == "Args:" {print substr($2, 2, length($2)-2)}')
+ # Sanity check
+ atf_check -s exit:0 -o ignore \
+ ifconfig $ngeth
+ jail -c name="eiface_destroy_$i" path=/ vnet vnet.interface="$ngeth" exec.start="sleep 0.1" &
+ pid=$!
+ sleep 0.1
+ ngctl shutdown ${ngeth}:
+ wait $pid
+ done
+
+ ngctl shutdown ${br}:
+ ifconfig $epair destroy
+}
+
+pr292993_cleanup()
+{
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case "pr292993"
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 27, 4:23 AM (17 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33546302
Default Alt Text
D56609.id176297.diff (2 KB)
Attached To
Mode
D56609: tests: Add a test for races between between if_detach() and vnet_if_return()
Attached
Detach File
Event Timeline
Log In to Comment