From nobody Fri Aug 15 04:54:06 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4c38sB6b4Jz64Xcc; Fri, 15 Aug 2025 04:54:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c38sB3Qswz3sWF; Fri, 15 Aug 2025 04:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755233646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNIN132FOnncgrG/TQsz/2tHV7w+WsEjv5ByTA0zysA=; b=LVOvJae7slGEYD8G5a4/no0mkOntg5MAFwDiqiozzRq6Nokj5goGc4p6prphinzpKUMQ3e ndSzVqYgSCme7sHONvBMnRYpfsp/His+6ynWuv02Rb//ozijOXsTWqxyF5YXVbuObDGYRR L+u/Z3KtE4Alzni0cEWp6aAzaK5CZk3lW0lpLnDvecClsuQkG66oCXeJlZC6w4g+oY1oQU PlFOpc2hNt1IoBSmEkPmPX7cYPTmGAH6T0OEocNntiTSv1VjBVUeR/U8E3JxF39ALQPsdY Vb95E5r4+r13A+K33nhdiK3CV8/raMzrPvrB8bMUNriJuZx0I4J8rYPG6hMq4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1755233646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNIN132FOnncgrG/TQsz/2tHV7w+WsEjv5ByTA0zysA=; b=e18+T8YqHoRd/VBKds+8V0mb/spV3OXZx93dqRlXz1DJYirIH92Ief0DKD4Ja2g1PpxBuh 0ZYY8tXxwq4IJSVEl1IIqyXJPTns2ZQlW6pyHqXfH5Kwy1zRSu1b7Lta3cYq5yA49TnbDI s56nUbRGIzSGeujZ39T7J5xdMmufOeKTSF48TAM0sv3vtQ56c61DoIuGChSGh092gLXJ5e +5toqbcXe4irpdqAYt5ixygGQvBJ1101EjflvYRUk6t8NPuolBH3H/9lcPA0Sb7dNKfnc5 JetNvCSHtkmZrRS5l5cKiH3rGl6fN/RdJPBIGjuTtsjcGI7eguJ6wHtJJ6n9EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1755233646; a=rsa-sha256; cv=none; b=rxYf3vw0gEROh79BCk48WKRWt+uc3SVPhHarH7bkkjaSsV0GV4GSb+Z2spbV49Y8ehzf2P mZ4M4EFq1ZGM6w55SsCBlVg7JVqqPzSKae5M+7iisCATWb6+NiGtRQisvq5fk7lehyxWgV e+5StBYxwoRxsFIxBbALOLyVdMo8CyWZm17vg7I1UVcLkQuaHQhIwoKBjG6PorVbFhVJKn oBFFHldB4qFUel48+Gp2NXTwqT8Bi6RgATTppe3p/cXcx4Jx45QZJvd3uAAG5tVZw/t9Z4 tDsdqt9GDMNtGEbrnmbvAlJYkDMHsjGpz2r8W8xSzpIO0TXqmYUy7BR+/+dtWA== 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 4c38sB2l8Lz8hY; Fri, 15 Aug 2025 04:54:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57F4s6d6025348; Fri, 15 Aug 2025 04:54:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57F4s6e4025345; Fri, 15 Aug 2025 04:54:06 GMT (envelope-from git) Date: Fri, 15 Aug 2025 04:54:06 GMT Message-Id: <202508150454.57F4s6e4025345@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: c2806cddc647 - stable/14 - tests: gif(4): Add tests to cover all IPv[46] in IPv[46] setups List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c2806cddc64766b69daa42b4fb192f767e4b4705 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c2806cddc64766b69daa42b4fb192f767e4b4705 commit c2806cddc64766b69daa42b4fb192f767e4b4705 Author: Zhenlei Huang AuthorDate: 2025-08-01 16:33:10 +0000 Commit: Zhenlei Huang CommitDate: 2025-08-15 04:53:21 +0000 tests: gif(4): Add tests to cover all IPv[46] in IPv[46] setups While here, rename basic to 4in4 to be consistent with other tests. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51566 (cherry picked from commit 62439516cc9bba32ed2406f340326c4d37e4cc59) --- tests/sys/net/if_gif.sh | 147 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 141 insertions(+), 6 deletions(-) diff --git a/tests/sys/net/if_gif.sh b/tests/sys/net/if_gif.sh index 16b0b1a6fca0..5c7278d17e8f 100644 --- a/tests/sys/net/if_gif.sh +++ b/tests/sys/net/if_gif.sh @@ -26,14 +26,14 @@ . $(atf_get_srcdir)/../common/vnet.subr -atf_test_case "basic" "cleanup" -basic_head() +atf_test_case "4in4" "cleanup" +4in4_head() { - atf_set descr 'Basic gif(4) test' + atf_set descr 'IPv4 in IPv4 tunnel' atf_set require.user root } -basic_body() +4in4_body() { vnet_init if ! kldstat -q -m if_gif; then @@ -65,12 +65,147 @@ basic_body() jexec two ping -c 1 198.51.100.1 } -basic_cleanup() +4in4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "6in4" "cleanup" +6in4_head() +{ + atf_set descr 'IPv6 in IPv4 tunnel' + atf_set require.user root +} + +6in4_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a 192.0.2.1/24 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone tunnel 192.0.2.1 192.0.2.2 + jexec one ifconfig $gone inet6 no_dad 2001:db8:1::1/64 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b 192.0.2.2/24 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo tunnel 192.0.2.2 192.0.2.1 + jexec two ifconfig $gtwo inet6 no_dad 2001:db8:1::2/64 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 192.0.2.2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8:1::2 + atf_check -s exit:0 -o ignore \ + jexec two ping -6 -c 1 2001:db8:1::1 +} + +6in4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "4in6" "cleanup" +4in6_head() +{ + atf_set descr 'IPv4 in IPv6 tunnel' + atf_set require.user root +} + +4in6_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a inet6 no_dad 2001:db8::1/64 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone inet6 tunnel 2001:db8::1 2001:db8::2 + jexec one ifconfig $gone inet 198.51.100.1/24 198.51.100.2 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b inet6 no_dad 2001:db8::2/64 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo inet6 tunnel 2001:db8::2 2001:db8::1 + jexec two ifconfig $gtwo inet 198.51.100.2/24 198.51.100.1 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8::2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore \ + jexec two ping -c 1 198.51.100.1 +} + +4in6_cleanup() +{ + vnet_cleanup +} + +atf_test_case "6in6" "cleanup" +6in6_head() +{ + atf_set descr 'IPv6 in IPv6 tunnel' + atf_set require.user root +} + +6in6_body() +{ + vnet_init + if ! kldstat -q -m if_gif; then + atf_skip "This test requires if_gif" + fi + + epair=$(vnet_mkepair) + + vnet_mkjail one ${epair}a + jexec one ifconfig ${epair}a inet6 no_dad 2001:db8::1/64 up + gone=$(jexec one ifconfig gif create) + jexec one ifconfig $gone inet6 tunnel 2001:db8::1 2001:db8::2 + jexec one ifconfig $gone inet6 no_dad 2001:db8:1::1/64 up + + vnet_mkjail two ${epair}b + jexec two ifconfig ${epair}b inet6 no_dad 2001:db8::2/64 up + gtwo=$(jexec two ifconfig gif create) + jexec two ifconfig $gtwo inet6 tunnel 2001:db8::2 2001:db8::1 + jexec two ifconfig $gtwo inet6 no_dad 2001:db8:1::2/64 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8::2 + + # Tunnel test + atf_check -s exit:0 -o ignore \ + jexec one ping -6 -c 1 2001:db8:1::2 + atf_check -s exit:0 -o ignore \ + jexec two ping -6 -c 1 2001:db8:1::1 +} + +6in6_cleanup() { vnet_cleanup } atf_init_test_cases() { - atf_add_test_case "basic" + atf_add_test_case "4in4" + atf_add_test_case "6in4" + atf_add_test_case "4in6" + atf_add_test_case "6in6" }