From owner-dev-commits-src-all@freebsd.org Tue Mar 2 15:18:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 464D856C823; Tue, 2 Mar 2021 15:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dqgk14mbsz4X00; Tue, 2 Mar 2021 15:18:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EA1C18EB3; Tue, 2 Mar 2021 15:17:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 122FHwrO039833; Tue, 2 Mar 2021 15:17:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 122FHwWD039832; Tue, 2 Mar 2021 15:17:58 GMT (envelope-from git) Date: Tue, 2 Mar 2021 15:17:58 GMT Message-Id: <202103021517.122FHwWD039832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e11329536494 - stable/12 - bridge tests: Ensure that bridges in different jails get different MAC addresses MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e1132953649454ed7ae40e156c23de20d6a3827c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2021 15:18:03 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e1132953649454ed7ae40e156c23de20d6a3827c commit e1132953649454ed7ae40e156c23de20d6a3827c Author: Kristof Provost AuthorDate: 2020-04-19 16:30:49 +0000 Commit: Kristof Provost CommitDate: 2021-03-02 13:03:06 +0000 bridge tests: Ensure that bridges in different jails get different MAC addresses We used to have a problem where bridges created in different vnet jails would end up having the same mac address. This is now fixed by including the jail name as a seed for the mac address generation, but we should verify that it doesn't regress. (cherry picked from commit 2885ae0c3ca3ea93e1f227ecb3003db2e94f4129) --- tests/sys/net/if_bridge_test.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index cb9c297220b6..111281799e9d 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -271,6 +271,44 @@ delete_with_members_cleanup() vnet_cleanup } +atf_test_case "mac_conflict" "cleanup" +mac_conflict_head() +{ + atf_set descr 'Ensure that bridges in different jails get different mac addresses' + atf_set require.user root +} + +mac_conflict_body() +{ + vnet_init + + epair=$(vnet_mkepair) + + # Ensure the bridge module is loaded so jails can use it. + tmpbridge=$(vnet_mkbridge) + + vnet_mkjail bridge_mac_conflict_one ${epair}a + vnet_mkjail bridge_mac_conflict_two ${epair}b + + jexec bridge_mac_conflict_one ifconfig bridge create + jexec bridge_mac_conflict_one ifconfig bridge0 192.0.2.1/24 up \ + addm ${epair}a + jexec bridge_mac_conflict_one ifconfig ${epair}a up + + jexec bridge_mac_conflict_two ifconfig bridge create + jexec bridge_mac_conflict_two ifconfig bridge0 192.0.2.2/24 up \ + addm ${epair}b + jexec bridge_mac_conflict_two ifconfig ${epair}b up + + atf_check -s exit:0 -o ignore \ + jexec bridge_mac_conflict_one ping -c 3 192.0.2.2 +} + +mac_conflict_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -278,4 +316,5 @@ atf_init_test_cases() atf_add_test_case "static" atf_add_test_case "span" atf_add_test_case "delete_with_members" + atf_add_test_case "mac_conflict" }