Skip to content

Commit 627c4fd

Browse files
committed
[BPF] fix testing removing devices when vxlan is turned off
1 parent 9783590 commit 627c4fd

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

felix/fv/vxlan_test.go

+20-12
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ VXLAN topology before addin
845845
mtuStrV6 := "mtu 1430"
846846
if BPFMode() {
847847
mtuStr = "mtu 1500"
848+
mtuStrV6 = "mtu 1500"
848849
}
849850
for _, felix := range felixes {
850851
Eventually(func() string {
@@ -867,23 +868,26 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ VXLAN topology before addin
867868
_, err := client.FelixConfigurations().Create(context.Background(), felixConfig, options.SetOptions{})
868869
Expect(err).NotTo(HaveOccurred())
869870

870-
// Expect the ipv4 VXLAN device to be deleted.
871-
for _, felix := range felixes {
872-
Eventually(func() string {
873-
out, _ := felix.ExecOutput("ip", "-d", "link", "show", "vxlan.calico")
874-
return out
875-
}, "60s", "500ms").ShouldNot(ContainSubstring(mtuStr))
876-
// IPv6 ignores the VXLAN enabled flag and must be disabled at the pool level. As such the ipv6
877-
// interfaces should still exist at this point
878-
if !BPFMode() && enableIPv6 {
871+
if !BPFMode() || !enableIPv6 {
872+
// Expect the ipv4 VXLAN device to be deleted. In BPFMode
873+
// the same device is used for V6 as well
874+
for _, felix := range felixes {
879875
Eventually(func() string {
880-
out, _ := felix.ExecOutput("ip", "-d", "link", "show", "vxlan-v6.calico")
876+
out, _ := felix.ExecOutput("ip", "-d", "link", "show", "vxlan.calico")
881877
return out
882-
}, "60s", "500ms").Should(ContainSubstring(mtuStrV6))
878+
}, "60s", "500ms").ShouldNot(ContainSubstring(mtuStr))
879+
// IPv6 ignores the VXLAN enabled flag and must be disabled at the pool level. As such the ipv6
880+
// interfaces should still exist at this point
881+
if enableIPv6 {
882+
Eventually(func() string {
883+
out, _ := felix.ExecOutput("ip", "-d", "link", "show", "vxlan-v6.calico")
884+
return out
885+
}, "60s", "500ms").Should(ContainSubstring(mtuStrV6))
886+
}
883887
}
884888
}
885889

886-
if !BPFMode() && enableIPv6 {
890+
if enableIPv6 {
887891
ip6pool, err := client.IPPools().Get(context.Background(), infrastructure.DefaultIPv6PoolName, options.GetOptions{})
888892
Expect(err).NotTo(HaveOccurred())
889893
ip6pool.Spec.VXLANMode = "Never"
@@ -893,6 +897,10 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ VXLAN topology before addin
893897
// Expect the ipv6 VXLAN device to be deleted.
894898
for _, felix := range felixes {
895899
Eventually(func() string {
900+
if BPFMode() {
901+
out, _ := felix.ExecOutput("ip", "-d", "link", "show", "vxlan.calico")
902+
return out
903+
}
896904
out, _ := felix.ExecOutput("ip", "-d", "link", "show", "vxlan-v6.calico")
897905
return out
898906
}, "60s", "500ms").ShouldNot(ContainSubstring(mtuStrV6))

0 commit comments

Comments
 (0)