Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Mar 2021 15:17:55 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 51ddfd32cc99 - stable/12 - bridge test: adding and removing static addresses
Message-ID:  <202103021517.122FHtuO039770@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kp:

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

commit 51ddfd32cc9952a916d63b0c6780322b90f0873c
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2020-03-10 06:29:59 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-03-02 13:03:06 +0000

    bridge test: adding and removing static addresses
    
    Reviewed by:    philip
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D23960
    
    (cherry picked from commit d99bb677c1cf43b22e91d54c49a8b7f0592e6fce)
---
 tests/sys/net/if_bridge_test.sh | 57 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh
index afb260a86cc3..34b72c33bb36 100755
--- a/tests/sys/net/if_bridge_test.sh
+++ b/tests/sys/net/if_bridge_test.sh
@@ -135,8 +135,65 @@ stp_cleanup()
 	vnet_cleanup
 }
 
+atf_test_case "static" "cleanup"
+static_head()
+{
+	atf_set descr 'Bridge static address test'
+	atf_set require.user root
+}
+
+static_body()
+{
+	vnet_init
+
+	epair=$(vnet_mkepair)
+	bridge=$(vnet_mkbridge)
+
+	vnet_mkjail one ${bridge} ${epair}a
+
+	ifconfig ${epair}b up
+
+	jexec one ifconfig ${bridge} up
+	jexec one ifconfig ${epair}a up
+	jexec one ifconfig ${bridge} addm ${epair}a
+
+	# Wrong interface
+	atf_check -s exit:1 -o ignore -e ignore \
+	    jexec one ifconfig ${bridge} static ${epair}b 00:01:02:03:04:05
+
+	# Bad address format
+	atf_check -s exit:1 -o ignore -e ignore \
+	    jexec one ifconfig ${bridge} static ${epair}a 00:01:02:03:04
+
+	# Correct add
+	atf_check -s exit:0 -o ignore \
+	    jexec one ifconfig ${bridge} static ${epair}a 00:01:02:03:04:05
+
+	# List addresses
+	atf_check -s exit:0 -o ignore \
+	    jexec one ifconfig ${bridge} addr
+
+	# Delete with bad address format
+	atf_check -s exit:1 -o ignore -e ignore \
+	    jexec one ifconfig ${bridge} deladdr 00:01:02:03:04
+
+	# Delete with unlisted address
+	atf_check -s exit:1 -o ignore -e ignore \
+	    jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:06
+
+	# Correct delete
+	atf_check -s exit:0 -o ignore \
+	    jexec one ifconfig ${bridge} deladdr 00:01:02:03:04:05
+}
+
+static_cleanup()
+{
+	vnet_cleanup
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case "bridge_transmit_ipv4_unicast"
 	atf_add_test_case "stp"
+	atf_add_test_case "static"
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103021517.122FHtuO039770>