From 99cffc9dc5b6f670cad35bd63fd61046bf90bc90 Mon Sep 17 00:00:00 2001 From: bzsuni Date: Mon, 29 Jan 2024 17:43:15 +0800 Subject: [PATCH] add ip number check in R00008 Signed-off-by: bzsuni --- test/e2e/reliability/reliability_ip_test.go | 24 ++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/test/e2e/reliability/reliability_ip_test.go b/test/e2e/reliability/reliability_ip_test.go index 3987a3d43..5ec5c4253 100644 --- a/test/e2e/reliability/reliability_ip_test.go +++ b/test/e2e/reliability/reliability_ip_test.go @@ -35,7 +35,7 @@ var _ = Describe("IP Allocation", Label("Reliability_IP"), func() { BeforeEach(func() { ctx = context.Background() - IPNum = 100 + IPNum = 50 extraNum = 20 // create EgressGateway and pods @@ -109,6 +109,17 @@ var _ = Describe("IP Allocation", Label("Reliability_IP"), func() { Expect(err).NotTo(HaveOccurred()) creationTime := time.Since(creationStart) + // check egessgateway ip number + if egressConfig.EnableIPv4 { + Expect(egw.Status.IPUsage.IPv4Free).To(BeZero()) + Expect(egw.Status.IPUsage.IPv4Total).To(Equal(int(IPNum))) + } + + if egressConfig.EnableIPv6 { + Expect(egw.Status.IPUsage.IPv6Free).To(BeZero()) + Expect(egw.Status.IPUsage.IPv6Total).To(Equal(int(IPNum))) + } + // check eip By("check eip of pods") Expect(common.CheckPodsEgressIP(ctx, config, p2p, egressConfig.EnableIPv4, egressConfig.EnableIPv6, true)).NotTo(HaveOccurred(), "failed check eip") @@ -130,6 +141,17 @@ var _ = Describe("IP Allocation", Label("Reliability_IP"), func() { Expect(err).NotTo(HaveOccurred()) deletionTime := time.Since(deletionStart) + // check egessgateway ip number + if egressConfig.EnableIPv4 { + Expect(egw.Status.IPUsage.IPv4Free).To(Equal(int(IPNum))) + Expect(egw.Status.IPUsage.IPv4Total).To(Equal(int(IPNum))) + } + + if egressConfig.EnableIPv6 { + Expect(egw.Status.IPUsage.IPv6Free).To(Equal(int(IPNum))) + Expect(egw.Status.IPUsage.IPv6Total).To(Equal(int(IPNum))) + } + By("check eip of pods") Expect(common.CheckPodsEgressIP(ctx, config, p2p, egressConfig.EnableIPv4, egressConfig.EnableIPv6, false)).NotTo(HaveOccurred(), "failed check eip") Expect(err).NotTo(HaveOccurred())