Permalink
Browse files

Merge pull request #9 from vanadium/netstate-fix

lib/netstate: fix test for machines that have a 127.94 and 127.0 loca…
  • Loading branch information...
cosnicolaou committed Jun 29, 2017
2 parents d513b6b + f2974b7 commit a4b4937710e360572a474dfdd48cb10848b35f1b
Showing with 6 additions and 4 deletions.
  1. +6 −4 netstate/netstate_test.go
View
@@ -91,12 +91,14 @@ func TestConversions(t *testing.T) {
// ConvertToAddresses as we pass in.
all, _, _ := netstate.GetAllAddresses()
lb := all.Filter(netstate.IsLoopbackIP).Filter(netstate.IsUnicastIPv4)
if got, want := len(lb), 1; got < want {
t.Fatalf("got %v, want at lest %v, all: %v, lb: %v", got, want, all, lb)
for i, a := range lb {
if !netstate.IsUnicastIPv4(a) {
t.Fatalf("%v: %v is not a unicast IPv4 address", i, a)
}
}
al = netstate.ConvertToAddresses(lb.AsNetAddrs())
if got, want := len(al), 1; got < want {
t.Fatalf("got %v, want at least %v, al: %v", got, want, al)
if got, want := len(al), len(lb); got != want {
t.Fatalf("got %v, want %v, al: %v", got, want, al)
}
found := false
for _, a := range all {

0 comments on commit a4b4937

Please sign in to comment.