MCPcopy
hub / github.com/windtf/wireproxy / TestWireguardConfWithSubnet

Function TestWireguardConfWithSubnet

config_test.go:42–64  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestWireguardConfWithSubnet(t *testing.T) {
43 const config = `
44[Interface]
45PrivateKey = LAr1aNSNF9d0MjwUgAVC4020T0N/E5NUtqVv5EnsSz0=
46Address = 10.5.0.2/23
47DNS = 1.1.1.1
48
49[Peer]
50PublicKey = e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
51AllowedIPs = 0.0.0.0/0, ::/0
52Endpoint = 94.140.11.15:51820
53PersistentKeepalive = 25`
54 var cfg DeviceConfig
55 iniData, err := loadIniConfig(config)
56 if err != nil {
57 t.Fatal(err)
58 }
59
60 err = ParseInterface(iniData, &cfg)
61 if err != nil {
62 t.Fatal(err)
63 }
64}
65
66func TestWireguardConfWithManyAddress(t *testing.T) {
67 const config = `

Callers

nothing calls this directly

Calls 2

loadIniConfigFunction · 0.85
ParseInterfaceFunction · 0.85

Tested by

no test coverage detected