From nobody Sat Oct 4 16:44:28 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 4cfBFn2t8Cz69Jdq; Sat, 04 Oct 2025 16:44:29 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfBFn1dgcz3KQp; Sat, 04 Oct 2025 16:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596269; 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=jAcXlOUYd7CAVMVrr5SLHRhITIzDJ6mlFUFuUsB7Ri8=; b=UPmr2xmB0JigUif0kEdwaYHMIvYpPECUJGARBmKG+tsAHj7x2V/ecexY6HraxW66US9xpf B1fSDQEAtJTn9MhbC0p6YXhW0lQASsfSoE5Uq7RWzmHcrzNw9OzbGRNsrhoRre3rNt2+AG 59HEGzH55IQT2aTVikEaR2Aop6KvRWOoG44jKB/BqJ1KQvO7s2iV9mhDRN0wO0xb4n4yF4 /70FNj/RW6y/xsfC3oASYCWfEXXXFAuH+jFUAwRZonVc1rx7vYuvr04iCMvrJGzS1f5uta 9lswhTSLoLxbYvkvSaOoy/1hk0M4dWEoKAiy1KEwQ8OcZTegz2x1N41SZgLxww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759596269; 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=jAcXlOUYd7CAVMVrr5SLHRhITIzDJ6mlFUFuUsB7Ri8=; b=aKEb0MlY0I9AZ1lBZis7cD5QCIdCoHFNOoXdlM4rufu8HUQCpLOn37FZ/6FDsa6n9uzeQZ p7nZzTMmH9cB7b22wds8DGKyHjX9AZdfzhrcAGUXTUcQrsdbv3B1I6xKY+ldZWmDCxrhvB XRZVW0F6ZgSr6WCDC7+dSLDKxT8qjei51mQqJQRzJXEr5D6/DP28+zrwrDT/TjIuBmExkY uc7cJDHrmEfCc8Ls4ewWeulMEDoL0YUkuRvM3KAD1M88rp4aUHp+yxMsL+0IjGQ5QMajQF 407/aHfLYkL8LT7ZkTODe67V4BtICQRlasnOlapdBGHdSt6y59HkndMZn66YLQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759596269; a=rsa-sha256; cv=none; b=y2mjg4GAQjp3VQ9BBorFrwtlGPn6FYUHFkqiHAOt/fjXSliefRB4I+FFCXoX56mYmHPgvq Gej+IOgj8z+4XWYBtPztRXoaUjxTRjPZvW3t3aoAoGxv7ZkPfmhrhvJG+LnaCQhPHEcM5T ChCXEbInhDtGJQDm80yAFIBcb+fWR4dsRqNOL8LE1DShccScpAoF0L8YCkYX8OrrApvM8U aaJG3iFSYc1S+r4UL+Ygh+bkSBe1X7c6+IZusBeptNdvnmbdcbJFIlB5LUB9nHz+3sfFOH rU4ftx09OwNNbWgu5dcIeMgXmniGcOx/0KCw/o1E8BsdZgozPbA6rQafJwRZOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cfBFn0xDXzqpl; Sat, 04 Oct 2025 16:44:29 +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 594GiSUH057933; Sat, 4 Oct 2025 16:44:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 594GiS49057930; Sat, 4 Oct 2025 16:44:28 GMT (envelope-from git) Date: Sat, 4 Oct 2025 16:44:28 GMT Message-Id: <202510041644.594GiS49057930@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: 767db004475a - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 767db004475a4b6dacde2cc4fa6ce392e63df59d Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=767db004475a4b6dacde2cc4fa6ce392e63df59d commit 767db004475a4b6dacde2cc4fa6ce392e63df59d Author: Zhenlei Huang AuthorDate: 2025-08-01 16:33:10 +0000 Commit: Zhenlei Huang CommitDate: 2025-10-04 16:43:19 +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) (cherry picked from commit c2806cddc64766b69daa42b4fb192f767e4b4705) --- 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" }