diff --git a/test/extended/networking/network_segmentation.go b/test/extended/networking/network_segmentation.go index 9ad5ff6fa889..d118c7cd6113 100644 --- a/test/extended/networking/network_segmentation.go +++ b/test/extended/networking/network_segmentation.go @@ -287,34 +287,6 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User //By("checking non-kubelet default network host process can't reach the UDN pod") By("asserting UDN pod can't reach host via default network interface") - // tweak pod route to use default network interface as default - podAnno, err := unmarshalPodAnnotation(udnPod.Annotations, "default") - Expect(err).NotTo(HaveOccurred()) - for _, podIP := range podAnno.IPs { - ipCommand := []string{"exec", udnPod.Name, "--", "ip"} - if podIP.IP.To4() == nil { - ipCommand = append(ipCommand, "-6") - } - // 1. Find current default route and delete it - defRoute, err := e2ekubectl.RunKubectl(udnPod.Namespace, - append(ipCommand, "route", "show", "default")...) - Expect(err).NotTo(HaveOccurred()) - defRoute = strings.TrimSpace(defRoute) - if defRoute == "" { - continue - } - framework.Logf("Found default route %v, deleting", defRoute) - cmd := append(ipCommand, "route", "del") - _, err = e2ekubectl.RunKubectl(udnPod.Namespace, - append(cmd, strings.Split(defRoute, " ")...)...) - Expect(err).NotTo(HaveOccurred()) - - // 2. Add a new default route to use default network interface - gatewayIP := NextIP(Network(podIP).IP) - _, err = e2ekubectl.RunKubectl(udnPod.Namespace, - append(ipCommand, "route", "add", "default", "via", gatewayIP.String(), "dev", "eth0")...) - Expect(err).NotTo(HaveOccurred()) - } // Now try to reach the host from the UDN pod defaultPodHostIP := udnPod.Status.HostIPs for _, hostIP := range defaultPodHostIP { @@ -325,7 +297,7 @@ var _ = Describe("[sig-network][OCPFeatureGate:NetworkSegmentation][Feature:User } Consistently(func() bool { _, err := e2ekubectl.RunKubectl(udnPod.Namespace, "exec", udnPod.Name, "--", - ping, "-c", "1", "-W", "1", hostIP.IP, + ping, "-I", "eth0", "-c", "1", "-W", "1", hostIP.IP, ) return err == nil }, 4*time.Second).Should(BeFalse())