From nobody Tue Jan 17 10:07:03 2023 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 4Nx4Lc2mlXz2srY8; Tue, 17 Jan 2023 10:07:04 +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 4Nx4Lc1jJMz3mKW; Tue, 17 Jan 2023 10:07:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673950024; 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=s5fioCjovvMIxZhycHDvIxJ4TGK7Y+DHGuI5NXEwmF8=; b=QQSZFLjdD8mOBfvxLiRRfgGQq9b0FavS59nbPkppLFKjU387Mh2H26JYQmQLCE0G+j909I w9WMZSWeNh+IkhdzCl+yBaih+szl1J2oSDcr9FuBg8IWFsS1vDEqRAo5yPcyOyW0uP3x5h qDs5rdVQ1+kFYm3mrKcFQVCFUSValdjQ0INLv5aZ9a83IvHjwZfDpNErUlAK/voDCBbU/8 SSXUV51wVVmfFsHJru7xC4AElAoy0JIfNBmwp8uFrzO8zDb9LwmelZjXFECQdHZaO35r8P eeAzeLvgaq44bJWOc2vtQ2XMK6Z+tX5j8YkdF319znTs0LTKYcORq35/8rqqzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673950024; 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=s5fioCjovvMIxZhycHDvIxJ4TGK7Y+DHGuI5NXEwmF8=; b=VC9u9AzqeGNt4udRM/Te4IukA6czMRgWEib3KJkbVSDxkw/qetF5cfXSyR8pIWz9kJZ4Lf 1TAfm5Q84+0i4l43fM8dbebFD3C0336V4eLwq8jd2jdWdKJvsmqqAT2mRQuVpSYc0szYio zi35cTPFa27GWNUF7RoUXcjqNv83/9FwsGZTn4IQvVd0BBaPwozgfa+NrUmrXoxw0e33KJ W6uUefoGRtLrQf8QVdxm7fklkCdw6H7QlbMKeEsnbc1xYYoGP5qygZ0v5teXWjYOAnB+am GZsfEsqIQdOApi097imtzbfHCMJXCEYRm1jmAlLPQtA9FWn+bW8xJ9NU2rjXGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673950024; a=rsa-sha256; cv=none; b=EKwKJ3bxaL//RKMkreuvSNwSOjMWwmJOwHneuVTWBcWyQ6yrkA2Q59FDwp0iBYHyN6brG3 qY0UwSKb4l54g9PRZFnGEksJ2jginQTzzIunRhUjppHb4EeaBDeRE9ERrBdd0wG4nMJLIy FsJiiKTnrxTycWKcZ5hnYBiym7LvDwqPIqLqZ6giza3lJ0b+kO9zbS+JyEtPM7cOc5Wt8K 78qJQrnmrKALtEUEhf4r7xPSAumnuAplq8JjiQREme1zhmbv54iCEhnjSbmGU3YOZl6H9S XVf1QDjyttpoJgpXqcQ5nwErQ4gTw/lmb3XX/KnqeRiE6c64SSxeJWDkog9CxQ== 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 4Nx4Lc0dFKzSKy; Tue, 17 Jan 2023 10:07:04 +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 30HA73se034960; Tue, 17 Jan 2023 10:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30HA73nD034959; Tue, 17 Jan 2023 10:07:03 GMT (envelope-from git) Date: Tue, 17 Jan 2023 10:07:03 GMT Message-Id: <202301171007.30HA73nD034959@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: fe701c39e8aa - main - if_tun: Add basic connectivity test with nc tun support 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe701c39e8aa270a71b5010a1eb4b488a80dcae5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=fe701c39e8aa270a71b5010a1eb4b488a80dcae5 commit fe701c39e8aa270a71b5010a1eb4b488a80dcae5 Author: Tom Jones AuthorDate: 2023-01-17 10:05:00 +0000 Commit: Tom Jones CommitDate: 2023-01-17 10:05:50 +0000 if_tun: Add basic connectivity test with nc tun support Reviewed by: kevans Sponsored by: Zenarmor Sponsored by: OPNsense Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37435 --- tests/sys/net/if_tun_test.sh | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/tests/sys/net/if_tun_test.sh b/tests/sys/net/if_tun_test.sh index 64dc004e3a06..5f05ac7c5eff 100755 --- a/tests/sys/net/if_tun_test.sh +++ b/tests/sys/net/if_tun_test.sh @@ -2,7 +2,7 @@ . $(atf_get_srcdir)/../common/vnet.subr -atf_test_case "235704" "cleanup" +atf_test_case "235704" "basic" "cleanup" 235704_head() { atf_set descr "Test PR #235704" @@ -24,7 +24,44 @@ atf_test_case "235704" "cleanup" vnet_cleanup } +basic_head() +{ + atf_set descr "Test if_tun using nc" + atf_set require.user root +} + +basic_body() +{ + vnet_init + + epair=$(vnet_mkepair) + + tun_duke=$(ifconfig tun create) + tun_bass=$(ifconfig tun create) + + vnet_mkjail duke ${epair}a ${tun_duke} + vnet_mkjail bass ${epair}b ${tun_bass} + + jexec duke ifconfig ${epair}a inet 10.0.0.1/24 up + jexec bass ifconfig ${epair}b inet 10.0.0.2/24 up + + jexec duke nc -u -l --tun /dev/${tun_duke} 10.0.0.1 2600 & + jexec bass nc -u --tun /dev/${tun_bass} 10.0.0.1 2600 & + + jexec duke ifconfig ${tun_duke} inet 10.100.0.1/24 10.100.0.2 up + jexec bass ifconfig ${tun_bass} inet 10.100.0.2/24 10.100.0.1 up + + atf_check -s exit:0 -o ignore \ + jexec bass ping -c 1 10.100.0.1 +} + +basic_clean() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "235704" + atf_add_test_case "basic" }