Skip to content
Open
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
35 changes: 5 additions & 30 deletions e2etests/tests/evpn_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ package tests
import (
"context"
"fmt"
"k8s.io/utils/ptr"
"net"
"strings"
"time"

"k8s.io/utils/ptr"

frrk8sapi "github.com/metallb/frr-k8s/api/v1beta1"
"github.com/onsi/ginkgo/v2"
. "github.com/onsi/ginkgo/v2"
Expand Down Expand Up @@ -400,7 +401,7 @@ var _ = Describe("Routes between bgp and the fabric", Ordered, func() {
})
})

var _ = Describe("Routes between bgp and the fabric with iBGP testing e2e integration between a pod and the blue / red hosts", func() {
var _ = Describe("Routes between bgp and the fabric with iBGP testing e2e integration between a pod and the red hosts", func() {
var cs clientset.Interface
var routers openperouter.Routers
var nodes []corev1.Node
Expand Down Expand Up @@ -444,25 +445,6 @@ var _ = Describe("Routes between bgp and the fabric with iBGP testing e2e integr
},
}

vniBlue := v1alpha1.L3VNI{
ObjectMeta: metav1.ObjectMeta{
Name: "blue",
Namespace: openperouter.Namespace,
},
Spec: v1alpha1.L3VNISpec{
VRF: "blue",
HostSession: &v1alpha1.HostSession{
ASN: 64514,
HostASN: ptr.To(int64(64515)),
LocalCIDR: v1alpha1.LocalCIDRConfig{
IPv4: ptr.To("192.169.11.0/24"),
IPv6: ptr.To("2001:db8:2::/64"),
},
},
VNI: 200,
},
}

const testNamespace = "test-namespace-ibgp"
var testPod *corev1.Pod
var podNode *corev1.Node
Expand Down Expand Up @@ -508,21 +490,18 @@ var _ = Describe("Routes between bgp and the fabric with iBGP testing e2e integr

By("Creating the frr-k8s configuration for the node where the test pod runs and advertising all pod ips")
frrK8sConfigRedForPod := advertisePodToVNI(testPod, vniRed, nodeSelector)
frrK8sConfigBlueForPod := advertisePodToVNI(testPod, vniBlue, nodeSelector)

err = Updater.Update(config.Resources{
L3VNIs: []v1alpha1.L3VNI{
vniRed,
vniBlue,
},
FRRConfigurations: append(frrK8sConfigRedForPod, frrK8sConfigBlueForPod...),
FRRConfigurations: frrK8sConfigRedForPod,
})
Expect(err).NotTo(HaveOccurred())

frrK8sPodOnNode, err := frrk8s.PodForNode(cs, testPod.Spec.NodeName)
Expect(err).NotTo(HaveOccurred())
validateFRRK8sSessionForHostSession(vniRed.Name, *vniRed.Spec.HostSession, Established, frrK8sPodOnNode)
validateFRRK8sSessionForHostSession(vniBlue.Name, *vniBlue.Spec.HostSession, Established, frrK8sPodOnNode)
})

AfterEach(func() {
Expand Down Expand Up @@ -556,12 +535,8 @@ var _ = Describe("Routes between bgp and the fabric with iBGP testing e2e integr
externalHostIP := infra.HostARedIPv4
ipFamily := ipfamily.IPv4

var localCIDR string
localCIDR = ptr.Deref(vni.Spec.HostSession.LocalCIDR.IPv4, "")
localCIDR := ptr.Deref(vni.Spec.HostSession.LocalCIDR.IPv4, "")

if ipFamily == ipfamily.IPv6 {
localCIDR = ptr.Deref(vni.Spec.HostSession.LocalCIDR.IPv6, "")
}
hostSide, err := openperouter.HostIPFromCIDRForNode(localCIDR, podNode)
Expect(err).NotTo(HaveOccurred())

Expand Down
Loading