Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unittest for IPAM #2977

Merged
merged 3 commits into from Jun 25, 2023
Merged

add unittest for IPAM #2977

merged 3 commits into from Jun 25, 2023

Conversation

zhangzujian
Copy link
Member

@zhangzujian zhangzujian commented Jun 25, 2023

What type of this PR

  • Tests

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

馃 Generated by Copilot at 785068c

This pull request enhances the ipam package by using the BigInt type for large IP ranges, fixing some bugs related to IP versions, and adding unit tests. It also updates the kubeovn API to use the BigInt type in the IPPoolStatus struct and implements the deep copy logic for it.

馃 Generated by Copilot at 785068c

No more loss of precision in the IP range
We use the BigInt type to count every byte
We merge and split the subnets with rage
We test our code with fire and might

HOW

馃 Generated by Copilot at 785068c

  • Replace float64 with internal.BigInt to represent large numbers of IPs without losing precision (link, link, link, link, link, link, link, link, link, link, link)
  • Fix bugs in NewIP, Add, and Sub methods of IP type that cause incorrect IP length or value (link, link, link)
  • Fix bugs in Merge method of IPRangeList type that cause skipping adjacent ranges (link, link)
  • Simplify NewIPRangeList function to accept variadic argument of IP type (link)
  • Use NewEmptyIPRangeList function to create empty IPRangeLists instead of NewIPRangeList (link, link, link, link, link, link, link, link, link, link, link, link)
  • Add unit tests for IP, IPRange, and IPRangeList types and methods in test/unittest/ipam package (link, link, link)

@zhangzujian zhangzujian added the test automation tests label Jun 25, 2023
@zhangzujian zhangzujian marked this pull request as ready for review June 25, 2023 08:24
@zhangzujian zhangzujian merged commit dc40a8c into kubeovn:master Jun 25, 2023
55 of 58 checks passed
@zhangzujian zhangzujian deleted the ippool-test branch June 25, 2023 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test automation tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants