Skip to content

Commit

Permalink
E2E: extend tests to check graceful restart
Browse files Browse the repository at this point in the history
Signed-off-by: karampok <[email protected]>
  • Loading branch information
karampok committed Jul 1, 2024
1 parent 9d64c4c commit 076f6cc
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions e2etests/tests/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ var _ = ginkgo.Describe("Advertisement", func() {
}
})

ginkgo.DescribeTable("Establishes sessions with cleartext password", func(family ipfamily.Family) {
ginkgo.DescribeTable("Establishes sessions with cleartext password and graceful restart", func(family ipfamily.Family) {
frrs := config.ContainersForVRF(infra.FRRContainers, "")
neighbors := []frrk8sv1beta1.Neighbor{}

Expand All @@ -136,11 +136,12 @@ var _ = ginkgo.Describe("Advertisement", func() {

for _, address := range addresses {
neighbors = append(neighbors, frrk8sv1beta1.Neighbor{
ASN: f.RouterConfig.ASN,
Address: address,
Password: f.RouterConfig.Password,
Port: &f.RouterConfig.BGPPort,
EBGPMultiHop: ebgpMultihop,
ASN: f.RouterConfig.ASN,
Address: address,
Password: f.RouterConfig.Password,
Port: &f.RouterConfig.BGPPort,
EBGPMultiHop: ebgpMultihop,
EnableGracefulRestart: true,
})
}
}
Expand Down Expand Up @@ -178,6 +179,30 @@ var _ = ginkgo.Describe("Advertisement", func() {
for _, c := range frrs {
ValidateFRRPeeredWithNodes(nodes, c, family)
}

ginkgo.By("getting all session are GR enabled")
pods, err := k8s.FRRK8sPods(cs)
Expect(err).NotTo(HaveOccurred())

for _, pod := range pods {
podExec := executor.ForPod(pod.Namespace, pod.Name, "frr")
Eventually(func() error {
neighbors, err := frr.NeighborsInfo(podExec)
if err != nil {
fmt.Println(err)
return err
}
for _, n := range neighbors {
Expect(n.GRInfo.LocalGrMode).Should(Equal("Restart"))
Expect(n.GRInfo.RemoteGrMode).Should(Equal("Helper"))
Expect(n.GRInfo.NBit).To(BeTrue())
Expect(n.GRInfo.RBit).To(BeTrue())

}
return nil
}, 2*time.Minute, time.Second).ShouldNot(HaveOccurred())
}

},
ginkgo.Entry("IPV4", ipfamily.IPv4),
ginkgo.Entry("IPV6", ipfamily.IPv6),
Expand Down

0 comments on commit 076f6cc

Please sign in to comment.