wgengine/router: add debug test to enumerate rules

No non-test changes.

Updates #391

Change-Id: Ia88610c08e07a119d002e58250463cb4659b9f54
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/3204/head
Brad Fitzpatrick 3 years ago
parent 6e5175373e
commit d36c0d3566

@ -733,3 +733,23 @@ func TestDebugListRoutes(t *testing.T) {
t.Logf("Route: %+v", r)
}
}
var famName = map[int]string{
netlink.FAMILY_ALL: "all",
netlink.FAMILY_V4: "v4",
netlink.FAMILY_V6: "v6",
}
func TestDebugListRules(t *testing.T) {
for _, fam := range []int{netlink.FAMILY_V4, netlink.FAMILY_V6, netlink.FAMILY_ALL} {
t.Run(famName[fam], func(t *testing.T) {
rules, err := netlink.RuleList(fam)
if err != nil {
t.Fatal(err)
}
for _, r := range rules {
t.Logf("Rule: %+v", r)
}
})
}
}

Loading…
Cancel
Save