(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func Test_IsValidAddressDefaults(t *testing.T) { |
| 12 | tests := []string{ |
| 13 | "127.0.0.1", |
| 14 | "127.0.0.5", |
| 15 | "10.0.0.9", |
| 16 | "172.16.0.7", |
| 17 | "192.168.2.1", |
| 18 | "fe80::aede:48ff:fe00:1122", |
| 19 | "::1", |
| 20 | } |
| 21 | config := DefaultLANConfig() |
| 22 | for _, ip := range tests { |
| 23 | localV4 := net.ParseIP(ip) |
| 24 | if err := config.IPAllowed(localV4); err != nil { |
| 25 | t.Fatalf("IP %s Localhost Should be accepted for LAN", ip) |
| 26 | } |
| 27 | } |
| 28 | config = DefaultWANConfig() |
| 29 | for _, ip := range tests { |
| 30 | localV4 := net.ParseIP(ip) |
| 31 | if err := config.IPAllowed(localV4); err != nil { |
| 32 | t.Fatalf("IP %s Localhost Should be accepted for WAN", ip) |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func Test_IsValidAddressOverride(t *testing.T) { |
| 38 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…