Skip to content

Commit

Permalink
add ip number check in R00008
Browse files Browse the repository at this point in the history
Signed-off-by: bzsuni <[email protected]>
  • Loading branch information
bzsuni committed Jan 29, 2024
1 parent eb55156 commit 99cffc9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/e2e/reliability/reliability_ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand All @@ -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())
Expand Down

0 comments on commit 99cffc9

Please sign in to comment.