Skip to content

100% coverage for ipam package - and bugfixes#60

Merged
Levovar merged 4 commits into
masterfrom
ipam_uts
Mar 16, 2019
Merged

100% coverage for ipam package - and bugfixes#60
Levovar merged 4 commits into
masterfrom
ipam_uts

Conversation

@Levovar
Copy link
Copy Markdown
Collaborator

@Levovar Levovar commented Mar 14, 2019

Bugs caught and corrected during UTing this package:
1: Last IP from the allocation pool was never used
2: When Pool.End was not provided, we set the first IP into this parameter, rather than the last.
This has resulted in failing validation for a subnet providing only CIDR without allocation pool
3: Static IPs were not validated against the allocation pool
4: When the allocation pool is entirely exhausted, we did not explicitly return an error, but let DANM proceed with setting up an interface without an IP. This has been changed now

None, static, dynamic cases are all covered, with al ledge cases.

Caught a number of bugs!

1: Last IP from the allocation pool was never used
2: When Pool.End was not provided, we set the first IP into this parameter, rather than the last
3: Static IPs were not validated against the allocation pool
@Levovar Levovar changed the title 100% coverage for ipam package 100% coverage for ipam package - and bugfixes Mar 15, 2019
Levovar added 2 commits March 15, 2019 19:38
…served by IPAM are reflected in the DanmNet's alloc bitarray.

Checkcan be pre-configured into the stub, and will be automatically invoked during Update REST API call.
All allocation cases are properly covered now.
@Levovar
Copy link
Copy Markdown
Collaborator Author

Levovar commented Mar 15, 2019

5: Added a new check, explicitly returning an error if an IPv6 address is requested for a subnet smaller than /64
6: Asking for an IP from a L2 IPv6 network now properly results in an explicit error returned to the caller, in both static, nad dynamic case
7: Requesting invalid, or malformed static IPv6 addresses now results in an explicit error returned to the caller

@Levovar
Copy link
Copy Markdown
Collaborator Author

Levovar commented Mar 15, 2019

8: if someone would have changed the allocated IP in a DanmEp to an invalid, or out-of-Cidr-range IP, ipam.Free wold have crashed and paniced
Added some checks to protect against such network /user corruption cases

@Levovar Levovar merged commit 77f7f16 into master Mar 16, 2019
@Levovar Levovar deleted the ipam_uts branch March 16, 2019 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant