(t *testing.T)
| 16 | } |
| 17 | |
| 18 | func TestWireguardConfWithoutSubnet(t *testing.T) { |
| 19 | const config = ` |
| 20 | [Interface] |
| 21 | PrivateKey = LAr1aNSNF9d0MjwUgAVC4020T0N/E5NUtqVv5EnsSz0= |
| 22 | Address = 10.5.0.2 |
| 23 | DNS = 1.1.1.1 |
| 24 | |
| 25 | [Peer] |
| 26 | PublicKey = e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= |
| 27 | AllowedIPs = 0.0.0.0/0, ::/0 |
| 28 | Endpoint = 94.140.11.15:51820 |
| 29 | PersistentKeepalive = 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 | |
| 42 | func TestWireguardConfWithSubnet(t *testing.T) { |
| 43 | const config = ` |
nothing calls this directly
no test coverage detected