diff --git a/.golangci.yml b/.golangci.yml index d596be5..ba5296b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,8 +4,9 @@ linters-settings: exclude-functions: - fmt:.* - io/ioutil:^Read.* - - github.com/fumiama/WireGold/helper.(*Writer).(Write.*) - - github.com/fumiama/WireGold/upper/services/tunnel.(*Tunnel).(Write|Read) + - os:\(\*File\)\..* + - github.com/fumiama/WireGold/helper:\(\*Writer\)\.Write.* + - github.com/fumiama/WireGold/upper/services/tunnel:\(\*Tunnel\)\.(Write|Read) goimports: local-prefixes: github.com/fumiama/WireGold diff --git a/upper/services/tunnel/tunnel_test.go b/upper/services/tunnel/tunnel_test.go index f1553c4..24a3c83 100644 --- a/upper/services/tunnel/tunnel_test.go +++ b/upper/services/tunnel/tunnel_test.go @@ -41,11 +41,13 @@ func TestTunnel(t *testing.T) { MTU: 4096, }) m.AddPeer(&link.PeerConfig{ - PeerIP: "192.168.1.3", - EndPoint: "127.0.0.1:21247", - AllowedIPs: []string{"192.168.1.3/32"}, - PubicKey: peerpk.Public(), - MTU: 4096, + PeerIP: "192.168.1.3", + EndPoint: "127.0.0.1:21247", + AllowedIPs: []string{"192.168.1.3/32"}, + PubicKey: peerpk.Public(), + MTU: 4096, + MTURandomRange: 1024, + UseZstd: true, }) p := link.NewMe(&link.MyConfig{ MyIPwithMask: "192.168.1.3/32", @@ -56,11 +58,13 @@ func TestTunnel(t *testing.T) { MTU: 4096, }) p.AddPeer(&link.PeerConfig{ - PeerIP: "192.168.1.2", - EndPoint: "127.0.0.1:21246", - AllowedIPs: []string{"192.168.1.2/32"}, - PubicKey: selfpk.Public(), - MTU: 4096, + PeerIP: "192.168.1.2", + EndPoint: "127.0.0.1:21246", + AllowedIPs: []string{"192.168.1.2/32"}, + PubicKey: selfpk.Public(), + MTU: 4096, + MTURandomRange: 1024, + UseZstd: true, }) tunnme, err := Create(&m, "192.168.1.3") if err != nil { @@ -102,6 +106,8 @@ func TestTunnel(t *testing.T) { t.Log("read", n, "bytes") if string(sendb) != string(buf) { t.Fatal("error: recv 65535 bytes data") + t.Log("expect", hex.EncodeToString(sendb)) + t.Log("got", hex.EncodeToString(buf)) } tunnme.Stop()