Skip to content

Commit

Permalink
Fix svc loop prevention FVs
Browse files Browse the repository at this point in the history
  • Loading branch information
sridhartigera committed Jun 7, 2024
1 parent dcf13a6 commit d667ded
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions felix/fv/service_loop_prevention_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ service loop prevention; wi
infra = getInfra()

options := infrastructure.DefaultTopologyOptions()
if BPFMode() {
options.EnableIPv6 = true
}
options.IPIPEnabled = false
tc, client = infrastructure.StartNNodeTopology(2, options, infra)
if BPFMode() {
Expand Down Expand Up @@ -183,10 +180,6 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ service loop prevention; wi
Eventually(func() string {
return bpfDumpRoutesV4(felix)
}, "10s", "1s").Should(ContainSubstring("10.96.0.0/17: blackhole-drop"))

Eventually(func() string {
return bpfDumpRoutesV6(felix)
}, "10s", "1s").Should(ContainSubstring("fd5f::/119: blackhole-drop"))
} else {
Eventually(getCIDRBlockRules(felix, "iptables-save")).Should(ConsistOf(
MatchRegexp("-A cali-cidr-block -d 10\\.96\\.0\\.0/17 .* -j DROP"),
Expand All @@ -210,10 +203,6 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ service loop prevention; wi
Eventually(func() string {
return bpfDumpRoutesV4(felix)
}, "10s", "1s").Should(ContainSubstring("10.96.0.0/17: blackhole-reject"))

Eventually(func() string {
return bpfDumpRoutesV6(felix)
}, "10s", "1s").Should(ContainSubstring("fd5f::/119: blackhole-reject"))
} else {
Eventually(getCIDRBlockRules(felix, "iptables-save"), "8s", "0.5s").Should(ConsistOf(
MatchRegexp("-A cali-cidr-block -d 10\\.96\\.0\\.0/17 .* -j REJECT"),
Expand All @@ -237,10 +226,6 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ service loop prevention; wi
Eventually(func() string {
return bpfDumpRoutesV4(felix)
}, "10s", "1s").ShouldNot(ContainSubstring("10.96.0.0/17: blackhole"))

Eventually(func() string {
return bpfDumpRoutesV6(felix)
}, "10s", "1s").ShouldNot(ContainSubstring("fd5f::/119: blackhole"))
} else {
Eventually(getCIDRBlockRules(felix, "iptables-save"), "8s", "0.5s").Should(BeEmpty())
Eventually(getCIDRBlockRules(felix, "ip6tables-save"), "8s", "0.5s").Should(BeEmpty())
Expand All @@ -261,10 +246,6 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ service loop prevention; wi
Eventually(func() string {
return bpfDumpRoutesV4(felix)
}, "10s", "1s").Should(ContainSubstring("10.96.0.0/17: blackhole-drop"))

Eventually(func() string {
return bpfDumpRoutesV6(felix)
}, "10s", "1s").Should(ContainSubstring("fd5f::/119: blackhole-drop"))
} else {
Eventually(getCIDRBlockRules(felix, "iptables-save"), "8s", "0.5s").Should(ConsistOf(
MatchRegexp("-A cali-cidr-block -d 10\\.96\\.0\\.0/17 .* -j DROP"),
Expand Down Expand Up @@ -294,10 +275,6 @@ var _ = infrastructure.DatastoreDescribe("_BPF-SAFE_ service loop prevention; wi
Eventually(func() string {
return bpfDumpRoutesV4(felix)
}, "10s", "1s").Should(ContainSubstring("1.1.0.0/16: blackhole-drop"))

Eventually(func() string {
return bpfDumpRoutesV6(felix)
}, "10s", "1s").Should(ContainSubstring("fd5e::/119: blackhole-drop"))
} else {
Eventually(getCIDRBlockRules(felix, "iptables-save")).Should(ConsistOf(
MatchRegexp("-A cali-cidr-block -d 1\\.1\\.0\\.0/16 .* -j DROP"),
Expand Down

0 comments on commit d667ded

Please sign in to comment.