Date: Mon, 2 Aug 2021 15:04:04 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: 83dc038e594c - stable/12 - bridge tests: test linking bridges with a gif tunnel Message-ID: <202108021504.172F44bi071372@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=83dc038e594c6875ce44e79db2b8e494d53e5d5d commit 83dc038e594c6875ce44e79db2b8e494d53e5d5d Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-21 15:32:24 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-08-02 15:03:02 +0000 bridge tests: test linking bridges with a gif tunnel Fairly basic test case for using gif(4)'s ability to tunnel Ethernet traffic between bridges. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 4b765ab4cda051a6d9ceb5fb9cac80c7f3b910bf) --- tests/sys/net/if_bridge_test.sh | 66 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 4703efed46b8..b029d8d60419 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -452,6 +452,71 @@ stp_validation_cleanup() vnet_cleanup } +atf_test_case "gif" "cleanup" +gif_head() +{ + atf_set descr 'gif as a bridge member' + atf_set require.user root +} + +gif_body() +{ + vnet_init + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + vnet_mkjail two ${epair}b + + jexec one sysctl net.link.gif.max_nesting=2 + jexec two sysctl net.link.gif.max_nesting=2 + + jexec one ifconfig ${epair}a 192.0.2.1/24 up + jexec two ifconfig ${epair}b 192.0.2.2/24 up + + # Tunnel + gif_one=$(jexec one ifconfig gif create) + gif_two=$(jexec two ifconfig gif create) + + jexec one ifconfig ${gif_one} tunnel 192.0.2.1 192.0.2.2 + jexec one ifconfig ${gif_one} up + jexec two ifconfig ${gif_two} tunnel 192.0.2.2 192.0.2.1 + jexec two ifconfig ${gif_two} up + + bridge_one=$(jexec one ifconfig bridge create) + bridge_two=$(jexec two ifconfig bridge create) + jexec one ifconfig ${bridge_one} 198.51.100.1/24 up + jexec one ifconfig ${bridge_one} addm ${gif_one} + jexec two ifconfig ${bridge_two} 198.51.100.2/24 up + jexec two ifconfig ${bridge_two} addm ${gif_two} + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.0.2.2 + + # Test tunnel + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 -s 1200 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 -s 2000 198.51.100.2 + + # Higher MTU on the tunnel than on the underlying interface + jexec one ifconfig ${epair}a mtu 1000 + jexec two ifconfig ${epair}b mtu 1000 + + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 -s 1200 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 -s 2000 198.51.100.2 +} + +gif_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -463,4 +528,5 @@ atf_init_test_cases() atf_add_test_case "delete_with_members" atf_add_test_case "mac_conflict" atf_add_test_case "stp_validation" + atf_add_test_case "gif" }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108021504.172F44bi071372>