From nobody Mon May 08 16:13:55 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 4QFRDg6CZlz4B4nV; Mon, 8 May 2023 16:13:55 +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 4QFRDg5N2Jz3QyG; Mon, 8 May 2023 16:13:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683562435; 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=jcDvwqAVZgAEg43Ufs9TV3BLPctQiAp78s8Vw5ivqPI=; b=ommAqPajxkyl5fEQSyocyNG+2vTYEcJUT0hwIIR4+4zVDduhNKu7QapW1qOC0F9CqyV1iv jp4DmZQUGq8V52+2MR32ITFEP/U1jL4lv3ZladJRueC41ItgginLxojggTQi9c8FHxU2RO 1tsyZKlzBGFCbTIa8/oP8aXLDNZMqDZ3vJwLfZC0fTchYNNGvgpfk0BuK4+S0/fOuqfR+a ehDFv2CJWvqqaV/Ltnq0twv1E4MyT2KDXVEXxfY49/0CXK2aWhusC6P+QtupIeJZeUONnz VaiJtEdGZGQuixgz6/wG1QerCamf3U2BqavvnpTUChtXDGUlBqmbc0leZUuLqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683562435; 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=jcDvwqAVZgAEg43Ufs9TV3BLPctQiAp78s8Vw5ivqPI=; b=jaJKgGBlrv3U15mIPbfaVNE8rnQqIHUyseSbbTGLlCxwMNSPMQ967vuBtQKB/uq8UaCntt H59SDOW4hjFqoeTnc6bDTKsiaib6k44mK3Zm3kQyqsZFzyBnQfj3EsXk2CJdp2RmG5rXC+ T8P9WL4Z4bTacYh6NzQR/BMkF370xxx+Pr+lH5DLr7QY4ELCPTaPm+ebzrSTxIfYLVKmoO pBNouaPMtIIoo4PkD/uteOBIOmUusQixUlepyngd6fkbjtMTsJ7+PnDiFSTBbiRzCbOf6Q 9s1mxKSc8ZOaTcQ5N+ikK6wiSkZzCGk9p+xJtGJerAgSNIvY0ZRGs/vstLPvmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683562435; a=rsa-sha256; cv=none; b=d032giZ+N4nuI5wTHQuF32q9um44rNlDqyUCn2lCkFj/fCSc0b71HtXTtH9FFDCJ/0ytj/ rd6RXmw2uKHaVw2J4luxdsrsDwkt3LRtNtbKh+5+OPv+Jn5aHTPjkz6yTOZgF8DH9lnB6l TIE33oJcgSN4d4dZP/DtuqZrzgVduBMdpFYjSkHREAV/CdnIJKWtpj6baYPLuOzeru24xK 9uT5q6yWKIRQiP2KyuM0EVHlzTLNE+BfScKDarWsUzsNLyNTZxFBUaH2y6LY+34gdRATK0 TRk3o2qfIj+SMVSmZO6nUjC2je3f8SV8JNMHD/lhSBDc0ECiqUT9KZauoL24mw== 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 4QFRDg3xvvz16LC; Mon, 8 May 2023 16:13:55 +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 348GDtfY026095; Mon, 8 May 2023 16:13:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 348GDtgw026094; Mon, 8 May 2023 16:13:55 GMT (envelope-from git) Date: Mon, 8 May 2023 16:13:55 GMT Message-Id: <202305081613.348GDtgw026094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: f76df4718d27 - main - if_ovpn tests: fix route_to test case 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: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f76df4718d27f512a7f02cccc12b9b10cf6ad13a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f76df4718d27f512a7f02cccc12b9b10cf6ad13a commit f76df4718d27f512a7f02cccc12b9b10cf6ad13a Author: Kristof Provost AuthorDate: 2023-05-08 15:44:47 +0000 Commit: Kristof Provost CommitDate: 2023-05-08 15:44:47 +0000 if_ovpn tests: fix route_to test case * Move the .254 address to the tunnel device so we reply through the tunnel. * Remove the network route to 'break' routing, which we then 'fix' with pf's route-to, which is the functionality we wanted to test in the first place. Reported by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/net/if_ovpn/if_ovpn.sh | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh index 51d21b826e72..5500dd9f1f41 100644 --- a/tests/sys/net/if_ovpn/if_ovpn.sh +++ b/tests/sys/net/if_ovpn/if_ovpn.sh @@ -91,6 +91,8 @@ atf_test_case "4in4" "cleanup" # Give the tunnel time to come up sleep 10 + atf_check -s exit:0 -o ignore jexec b ping -c 1 198.51.100.1 + echo 'foo' | jexec b nc -u -w 2 192.0.2.1 1194 atf_check -s exit:0 -o ignore jexec b ping -c 3 198.51.100.1 } @@ -702,7 +704,6 @@ route_to_body() vnet_mkjail a ${l}a jexec a ifconfig ${l}a 192.0.2.1/24 up - jexec a ifconfig ${l}a inet alias 198.51.100.254/24 vnet_mkjail b ${l}b ${n}a jexec b ifconfig ${l}b 192.0.2.2/24 up jexec b ifconfig ${n}a up @@ -751,26 +752,23 @@ route_to_body() # Give the tunnel time to come up sleep 10 + jexec a ifconfig ovpn0 inet alias 198.51.100.254/24 # Check the tunnel - atf_check -s exit:0 -o ignore jexec b ping -c 1 198.51.100.1 - atf_check -s exit:0 -o ignore jexec b ping -c 1 198.51.100.254 + atf_check -s exit:0 -o ignore jexec b ping -c 1 -S 198.51.100.2 198.51.100.1 + atf_check -s exit:0 -o ignore jexec b ping -c 1 -S 198.51.100.2 198.51.100.254 + + # Break our route to .254 so that we need a route-to to make things work. + jexec b ifconfig ${n}a 203.0.113.1/24 up + jexec b route add 198.51.100.254 -interface ${n}a - # Break our routes so that we need a route-to to make things work. - jexec b ifconfig ${n}a 198.51.100.3/24 - atf_check -s exit:2 -o ignore jexec b ping -c 1 -t 1 -S 198.51.100.2 198.51.100.254 + # Make sure it's broken. + atf_check -s exit:2 -o ignore jexec b ping -c 1 -S 198.51.100.2 198.51.100.254 jexec b pfctl -e pft_set_rules b \ "pass out route-to (tun0 198.51.100.1) proto icmp from 198.51.100.2 " atf_check -s exit:0 -o ignore jexec b ping -c 3 -S 198.51.100.2 198.51.100.254 - - # And this keeps working even if we don't have a route to 198.51.100.0/24 via if_ovpn - jexec b route del -net 198.51.100.0/24 - jexec b route add -net 198.51.100.0/24 -interface ${n}a - pft_set_rules b \ - "pass out route-to (tun0 198.51.100.3) proto icmp from 198.51.100.2 " - atf_check -s exit:0 -o ignore jexec b ping -c 3 -S 198.51.100.2 198.51.100.254 } route_to_cleanup()