git: 2fc1fc66c7b4 - main - if_ovpn tests: Test if_ovpn when there's no route

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Tue, 28 Jun 2022 11:59:40 UTC
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=2fc1fc66c7b44060246b32030aad767f9a01a49f

commit 2fc1fc66c7b44060246b32030aad767f9a01a49f
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2022-06-14 12:37:06 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2022-06-28 11:51:30 +0000

    if_ovpn tests: Test if_ovpn when there's no route
    
    In client mode (i.e. if there's only one peer) we should be able to
    route to the correct peer even if the routing table is incorrect.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 tests/sys/net/if_ovpn/if_ovpn.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/sys/net/if_ovpn/if_ovpn.sh b/tests/sys/net/if_ovpn/if_ovpn.sh
index 3815f7b9d788..49266c6597e6 100644
--- a/tests/sys/net/if_ovpn/if_ovpn.sh
+++ b/tests/sys/net/if_ovpn/if_ovpn.sh
@@ -481,6 +481,13 @@ route_to_body()
 	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()