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

kola/tests/flannel: use docker0's interface address as destination #161

Merged
merged 1 commit into from
Mar 18, 2021
Merged
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
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")
}