Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the v6 unit test failing #1597

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion backend/route_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)
}
Expand Down
2 changes: 2 additions & 0 deletions dist/functional-test.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down