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

Function TestWireguardConfWithoutSubnet

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

Source from the content-addressed store, hash-verified

16}
17
18func TestWireguardConfWithoutSubnet(t *testing.T) {
19 const config = `
20[Interface]
21PrivateKey = LAr1aNSNF9d0MjwUgAVC4020T0N/E5NUtqVv5EnsSz0=
22Address = 10.5.0.2
23DNS = 1.1.1.1
24
25[Peer]
26PublicKey = e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w=
27AllowedIPs = 0.0.0.0/0, ::/0
28Endpoint = 94.140.11.15:51820
29PersistentKeepalive = 25`
30 var cfg DeviceConfig
31 iniData, err := loadIniConfig(config)
32 if err != nil {
33 t.Fatal(err)
34 }
35
36 err = ParseInterface(iniData, &cfg)
37 if err != nil {
38 t.Fatal(err)
39 }
40}
41
42func TestWireguardConfWithSubnet(t *testing.T) {
43 const config = `

Callers

nothing calls this directly

Calls 2

loadIniConfigFunction · 0.85
ParseInterfaceFunction · 0.85

Tested by

no test coverage detected