Fix e2e unsafe inbound test

This commit is contained in:
Nate Brown
2025-11-21 15:51:02 -06:00
parent c2381e7019
commit e25016a946
2 changed files with 11 additions and 2 deletions

View File

@@ -1341,6 +1341,13 @@ func TestGoodHandshakeUnsafeDest(t *testing.T) {
"tun": m{ "tun": m{
"unsafe_routes": []m{route}, "unsafe_routes": []m{route},
}, },
"firewall": m{
"unsafe_outbound": []m{{
"port": "any",
"proto": "any",
"host": "any",
}},
},
} }
myControl, myVpnIpNet, myUdpAddr, myConfig := newSimpleServer(cert.Version2, ca, caKey, "me", "10.128.0.1/24", myCfg) myControl, myVpnIpNet, myUdpAddr, myConfig := newSimpleServer(cert.Version2, ca, caKey, "me", "10.128.0.1/24", myCfg)
t.Logf("my config %v", myConfig) t.Logf("my config %v", myConfig)

View File

@@ -85,8 +85,9 @@ func newSimpleServerWithUdpAndUnsafeNetworks(v cert.Version, caCrt cert.Certific
}} }}
var unsafeNetworks []netip.Prefix var unsafeNetworks []netip.Prefix
var firewallUnsafeInbound []m
if sUnsafeNetworks != "" { if sUnsafeNetworks != "" {
firewallInbound = []m{{ firewallUnsafeInbound = []m{{
"proto": "any", "proto": "any",
"port": "any", "port": "any",
"host": "any", "host": "any",
@@ -123,6 +124,7 @@ func newSimpleServerWithUdpAndUnsafeNetworks(v cert.Version, caCrt cert.Certific
"host": "any", "host": "any",
}}, }},
"inbound": firewallInbound, "inbound": firewallInbound,
"unsafe_inbound": firewallUnsafeInbound,
}, },
//"handshakes": m{ //"handshakes": m{
// "try_interval": "1s", // "try_interval": "1s",