(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestWireguardConfWithSubnet(t *testing.T) { |
| 43 | const config = ` |
| 44 | [Interface] |
| 45 | PrivateKey = LAr1aNSNF9d0MjwUgAVC4020T0N/E5NUtqVv5EnsSz0= |
| 46 | Address = 10.5.0.2/23 |
| 47 | DNS = 1.1.1.1 |
| 48 | |
| 49 | [Peer] |
| 50 | PublicKey = e8LKAc+f9xEzq9Ar7+MfKRrs+gZ/4yzvpRJLRJ/VJ1w= |
| 51 | AllowedIPs = 0.0.0.0/0, ::/0 |
| 52 | Endpoint = 94.140.11.15:51820 |
| 53 | PersistentKeepalive = 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 | |
| 66 | func TestWireguardConfWithManyAddress(t *testing.T) { |
| 67 | const config = ` |
nothing calls this directly
no test coverage detected