Skip to content

Commit 78e2abb

Browse files
committed
sbr: Add test for preserveDefaultRoutes option
Add test that verifies the preserveDefaultRoutes option correctly maintains subnet routes in the main routing table with source IP hints for destination- based routing. The test verifies: - Source-based routing rules are created (table 100) - Subnet routes exist in main table with source hints - Subnet routes also exist in table 100 - Default routes exist in table 100 This enables both explicit source routing (ping -I) and destination-based routing (plain ping) to work simultaneously. Signed-off-by: David Whyte-Gray <[email protected]>
1 parent 9abdf21 commit 78e2abb

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

plugins/meta/sbr/sbr_linux_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,8 +691,6 @@ var _ = Describe("sbr test", func() {
691691
}
692692
Expect(foundDefaultRoute).To(BeTrue(), "Expected to find default route with static gateway")
693693
})
694-
<<<<<<< Updated upstream
695-
=======
696694

697695
It("Works with preserveDefaultRoutes enabled", func() {
698696
ifname := "net1"
@@ -753,7 +751,7 @@ var _ = Describe("sbr test", func() {
753751
for _, route := range devNet1.Routes {
754752
// Look for subnet route (192.168.1.0/24) in main table with source hint
755753
if route.Dst != nil && route.Dst.IP.Equal(net.IPv4(192, 168, 1, 0)) &&
756-
route.Dst.Mask.String() == "ffffff00" {
754+
route.Dst.Mask.String() == "ffffff00" {
757755
if route.Table == 254 || route.Table == 0 { // 0 is treated as main
758756
Expect(route.Src.String()).To(Equal("192.168.1.209"),
759757
"Subnet route in main table should have source IP hint")
@@ -779,5 +777,4 @@ var _ = Describe("sbr test", func() {
779777
Expect(foundDefaultRouteInTable100).To(BeTrue(),
780778
"Expected default route in table 100")
781779
})
782-
>>>>>>> Stashed changes
783780
})

0 commit comments

Comments
 (0)