Skip to content

Commit

Permalink
fix e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Jun 29, 2023
1 parent 217389b commit 3a70281
Showing 1 changed file with 35 additions and 8 deletions.
43 changes: 35 additions & 8 deletions test/e2e/kube-ovn/ipam/ipam.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,41 @@ var _ = framework.Describe("[group:ipam]", func() {
ippool = ippoolClient.CreateSync(ippool)

ginkgo.By("Validating ippool status")
framework.ExpectTrue(ippool.Status.V4UsingIPs.EqualInt64(0))
framework.ExpectTrue(ippool.Status.V6UsingIPs.EqualInt64(0))
framework.ExpectEmpty(ippool.Status.V4UsingIPRange)
framework.ExpectEmpty(ippool.Status.V6UsingIPRange)
framework.ExpectTrue(ippool.Status.V4AvailableIPs.Equal(ipv4Range.Count()))
framework.ExpectTrue(ippool.Status.V6AvailableIPs.Equal(ipv6Range.Count()))
framework.ExpectEqual(ippool.Status.V4AvailableIPRange, ipv4Range.String())
framework.ExpectEqual(ippool.Status.V6AvailableIPRange, ipv6Range.String())
framework.WaitUntil(2*time.Second, 30*time.Second, func(_ context.Context) (bool, error) {
if !ippool.Status.V4UsingIPs.EqualInt64(0) {
framework.Logf("unexpected .status.v4UsingIPs: %s", ippool.Status.V4UsingIPs)
return false, nil
}
if !ippool.Status.V6UsingIPs.EqualInt64(0) {
framework.Logf("unexpected .status.v6UsingIPs: %s", ippool.Status.V6UsingIPs)
return false, nil
}
if ippool.Status.V4UsingIPRange != "" {
framework.Logf("unexpected .status.v4UsingIPRange: %s", ippool.Status.V4UsingIPRange)
return false, nil
}
if ippool.Status.V6UsingIPRange != "" {
framework.Logf("unexpected .status.v6UsingIPRange: %s", ippool.Status.V6UsingIPRange)
return false, nil
}
if !ippool.Status.V4AvailableIPs.Equal(ipv4Range.Count()) {
framework.Logf(".status.v4AvailableIPs mismatch: expect %s, actual %s", ipv4Range.Count(), ippool.Status.V4AvailableIPs)
return false, nil
}
if !ippool.Status.V6AvailableIPs.Equal(ipv6Range.Count()) {
framework.Logf(".status.v6AvailableIPs mismatch: expect %s, actual %s", ipv6Range.Count(), ippool.Status.V6AvailableIPs)
return false, nil
}
if ippool.Status.V4AvailableIPRange != ipv4Range.String() {
framework.Logf(".status.v4AvailableIPRange mismatch: expect %s, actual %s", ipv4Range, ippool.Status.V4AvailableIPRange)
return false, nil
}
if ippool.Status.V6AvailableIPRange != ipv6Range.String() {
framework.Logf(".status.v6AvailableIPRange mismatch: expect %s, actual %s", ipv6Range, ippool.Status.V6AvailableIPRange)
return false, nil
}
return true, nil
}, "")

ginkgo.By("Creating deployment " + deployName + " within ippool " + ippoolName)
replicas := 3
Expand Down

0 comments on commit 3a70281

Please sign in to comment.