Skip to content

Commit

Permalink
Merge pull request #161 from kinvolk/kai/flannel
Browse files Browse the repository at this point in the history
kola/tests/flannel: use docker0's interface address as destination
  • Loading branch information
pothos authored Mar 18, 2021
2 parents 947d067 + e77419c commit 55aca55
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions kola/tests/flannel/flannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ func mach2bip(c cluster.TestCluster, m platform.Machine, ifname string) (string,
}

// ping sends icmp packets from machine a to b using the ping tool.
func ping(c cluster.TestCluster, a, b platform.Machine, ifname string) {
srcip, err := mach2bip(c, a, ifname)
func ping(c cluster.TestCluster, a, b platform.Machine, ifnameA, ifnameB string) {
srcip, err := mach2bip(c, a, ifnameA)
if err != nil {
c.Fatalf("failed to get docker bridge ip #1: %v", err)
}

dstip, err := mach2bip(c, b, ifname)
dstip, err := mach2bip(c, b, ifnameB)
if err != nil {
c.Fatalf("failed to get docker bridge ip #2: %v", err)
}
Expand Down Expand Up @@ -129,7 +129,9 @@ func udp(c cluster.TestCluster) {
c.Fatalf("cluster health: %v", err)
}

ping(c, machs[0], machs[2], "flannel0")
// ping the docker0 address .1/24 instead of the flannel0 address .0/32
// because it does not work after a flanneld restart
ping(c, machs[0], machs[2], "flannel0", "docker0")
}

// VXLAN tests that flannel can send packets using the vxlan backend.
Expand All @@ -141,5 +143,5 @@ func vxlan(c cluster.TestCluster) {
c.Fatalf("cluster health: %v", err)
}

ping(c, machs[0], machs[2], "flannel.1")
ping(c, machs[0], machs[2], "flannel.1", "flannel.1")
}

0 comments on commit 55aca55

Please sign in to comment.