MCPcopy
hub / github.com/hashicorp/memberlist / Test_IsValidAddressDefaults

Function Test_IsValidAddressDefaults

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

Source from the content-addressed store, hash-verified

9)
10
11func 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
37func Test_IsValidAddressOverride(t *testing.T) {
38 t.Parallel()

Callers

nothing calls this directly

Calls 4

DefaultLANConfigFunction · 0.85
DefaultWANConfigFunction · 0.85
IPAllowedMethod · 0.80
FatalfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…