From aab104ae2e282ae1ee20fff2367596d731dd8eda Mon Sep 17 00:00:00 2001 From: Toby Date: Fri, 22 Mar 2024 16:20:03 -0700 Subject: [PATCH] feat: update config test --- app/cmd/client_test.go | 22 ++++++++++++++++++++++ app/cmd/client_test.yaml | 14 ++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/app/cmd/client_test.go b/app/cmd/client_test.go index faee251..c586949 100644 --- a/app/cmd/client_test.go +++ b/app/cmd/client_test.go @@ -88,6 +88,28 @@ func TestClientConfig(t *testing.T) { TCPRedirect: &tcpRedirectConfig{ Listen: "127.0.0.1:3500", }, + TUN: &tunConfig{ + Name: "hytun", + MTU: 1500, + Timeout: 60 * time.Second, + Address: struct { + IPv4 string `mapstructure:"ipv4"` + IPv6 string `mapstructure:"ipv6"` + }{IPv4: "100.100.100.101/30", IPv6: "2001::ffff:ffff:ffff:fff1/126"}, + Route: &struct { + Strict bool `mapstructure:"strict"` + IPv4 []string `mapstructure:"ipv4"` + IPv6 []string `mapstructure:"ipv6"` + IPv4Exclude []string `mapstructure:"ipv4Exclude"` + IPv6Exclude []string `mapstructure:"ipv6Exclude"` + }{ + Strict: true, + IPv4: []string{"0.0.0.0/0"}, + IPv6: []string{"2000::/3"}, + IPv4Exclude: []string{"192.0.2.1/32"}, + IPv6Exclude: []string{"2001:db8::1/128"}, + }, + }, }) } diff --git a/app/cmd/client_test.yaml b/app/cmd/client_test.yaml index 3e2f4aa..4f919df 100644 --- a/app/cmd/client_test.yaml +++ b/app/cmd/client_test.yaml @@ -65,3 +65,17 @@ udpTProxy: tcpRedirect: listen: 127.0.0.1:3500 + +tun: + name: "hytun" + mtu: 1500 + timeout: 1m + address: + ipv4: 100.100.100.101/30 + ipv6: 2001::ffff:ffff:ffff:fff1/126 + route: + strict: true + ipv4: [0.0.0.0/0] + ipv6: ["2000::/3"] + ipv4Exclude: [192.0.2.1/32] + ipv6Exclude: ["2001:db8::1/128"]