Source-Changes-HG archive

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

[src/trunk]: src/tests/net/if_vlan Added a test about clearing IFF_PROMISC at...



details:   https://anonhg.NetBSD.org/src/rev/53420d4cf6f2
branches:  trunk
changeset: 1022352:53420d4cf6f2
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Wed Jul 14 06:35:59 2021 +0000

description:
Added a test about clearing IFF_PROMISC at vlan_unconfig

This test is related to PR/49196

diffstat:

 tests/net/if_vlan/t_vlan.sh |  23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r a3912d700f1c -r 53420d4cf6f2 tests/net/if_vlan/t_vlan.sh
--- a/tests/net/if_vlan/t_vlan.sh       Wed Jul 14 06:34:33 2021 +0000
+++ b/tests/net/if_vlan/t_vlan.sh       Wed Jul 14 06:35:59 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_vlan.sh,v 1.20 2021/07/09 05:54:11 yamaguchi Exp $
+#      $NetBSD: t_vlan.sh,v 1.21 2021/07/14 06:35:59 yamaguchi Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -986,6 +986,27 @@
 
        atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig vlan0
        atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig shmif0
+       $atf_ifconfig vlan0 -vlanif
+
+       #
+       # clear IFF_PROMISC after bpf_detach called from ether_ifdetach
+       #
+       $atf_ifconfig vlan0 vlan 1 vlanif shmif0
+       $atf_ifconfig vlan0 up
+
+       $bpfopen -r vlan0 &
+       pid=$!
+
+       atf_check -s exit:0 -o match:'PROMISC' rump.ifconfig vlan0
+       atf_check -s exit:0 -o match:'PROMISC' rump.ifconfig shmif0
+
+       $atf_ifconfig vlan0 -vlanif
+
+       atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig vlan0
+       atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig shmif0
+
+       kill -TERM $pid
+       atf_check -s exit:0 -o not-match:'PROMISC' rump.ifconfig vlan0
 }
 
 vlan_promisc_cleanup()



Home | Main Index | Thread Index | Old Index