Finally rid of capital Sirupsen??

This commit is contained in:
Travis Reeder
2017-09-18 23:33:47 -07:00
parent f335d34636
commit 3aecebdf48
1127 changed files with 41199 additions and 41383 deletions

View File

@@ -14,21 +14,28 @@ import (
)
func TestFetchAndParseRIB(t *testing.T) {
for _, af := range []int{sysAF_UNSPEC, sysAF_INET, sysAF_INET6} {
for _, typ := range []RIBType{sysNET_RT_DUMP, sysNET_RT_IFLIST} {
ms, err := fetchAndParseRIB(af, typ)
for _, typ := range []RIBType{sysNET_RT_DUMP, sysNET_RT_IFLIST} {
var lastErr error
var ms []Message
for _, af := range []int{sysAF_UNSPEC, sysAF_INET, sysAF_INET6} {
rs, err := fetchAndParseRIB(af, typ)
if err != nil {
t.Error(err)
lastErr = err
continue
}
ss, err := msgs(ms).validate()
if err != nil {
t.Errorf("%v %d %v", addrFamily(af), typ, err)
continue
}
for _, s := range ss {
t.Log(s)
}
ms = append(ms, rs...)
}
if len(ms) == 0 && lastErr != nil {
t.Error(typ, lastErr)
continue
}
ss, err := msgs(ms).validate()
if err != nil {
t.Error(typ, err)
continue
}
for _, s := range ss {
t.Log(typ, s)
}
}
}
@@ -145,8 +152,8 @@ func TestRouteMessage(t *testing.T) {
var ms []RouteMessage
for _, af := range []int{sysAF_INET, sysAF_INET6} {
rs, err := fetchAndParseRIB(af, sysNET_RT_DUMP)
if err != nil || len(rs) == 0 {
if _, err := fetchAndParseRIB(af, sysNET_RT_DUMP); err != nil {
t.Log(err)
continue
}
switch af {
@@ -228,6 +235,5 @@ func TestRouteMessage(t *testing.T) {
for _, s := range ss {
t.Log(s)
}
}
}