mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
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>
This commit is contained in:
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…
Reference in New Issue
Block a user