diff --git a/backend/route_network_test.go b/backend/route_network_test.go index 772325a00..05e171ae4 100644 --- a/backend/route_network_test.go +++ b/backend/route_network_test.go @@ -109,7 +109,7 @@ func TestV6RouteCache(t *testing.T) { LinkIndex: nw.LinkIndex, } } - gw1, gw2 := ip.FromIP6(net.ParseIP("2001:db8:1::2")), ip.FromIP6(net.ParseIP("::2")) + gw1, gw2 := ip.FromIP6(net.ParseIP("2001:db8:1::2")), ip.FromIP6(net.ParseIP("2001:db8:1::10")) subnet1 := ip.IP6Net{IP: ip.FromIP6(net.ParseIP("2001:db8:ffff::")), PrefixLen: 64} nw.handleSubnetEvents([]subnet.Event{ {Type: subnet.EventAdded, Lease: subnet.Lease{ @@ -125,6 +125,19 @@ func TestV6RouteCache(t *testing.T) { nw.handleSubnetEvents([]subnet.Event{ {Type: subnet.EventAdded, Lease: subnet.Lease{ IPv6Subnet: subnet1, EnableIPv6: true, Attrs: subnet.LeaseAttrs{PublicIPv6: gw2, BackendType: "host-gw"}}}}) + linkbr, _ := netlink.LinkByName("br") + routes, _ := netlink.RouteList(linkbr, 6) + IsGw := "" + for _, route := range routes { + if len(route.Gw) != 0 { + IsGw = route.Gw.String() + } + } + + if IsGw != gw2.String() { + t.Fatal("Expected Gateway: ", gw2, " is not the same as the configured gateway: ", IsGw) + } + if len(nw.v6Routes) != 1 { t.Fatal(nw.v6Routes) } diff --git a/dist/functional-test.sh b/dist/functional-test.sh index b93e5853a..64cf00e1d 100755 --- a/dist/functional-test.sh +++ b/dist/functional-test.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -x + ARCH="${ARCH:-amd64}" ETCD_IMG="${ETCD_IMG:-quay.io/coreos/etcd:v3.2.7}" # etcd might take a bit to come up - use a known etcd version so we know we have etcdctl available