Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Conversation

@chenpiaoping
Copy link
Contributor

No description provided.

@chenpiaoping chenpiaoping changed the title add some UTs to cover all interfaces of IpAddrRangeRepo [Private IP Manager] Add some UTs to cover all interfaces of IpAddrRangeRepo Jul 1, 2020
Copy link
Contributor

@xieus xieus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

ipAddrRequest.setIp(null);
IpAddrAlloc ipAddrAlloc = ipAddrRangeRepo.allocateIpAddr(ipAddrRequest);
assertNotNull(ipAddrAlloc);
assertEquals(ipAddrAlloc.getIpAddr(), UnitTestConfig.ip1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion shows that our algorithm is predictable :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, sequentially.

@Test
public void allocateIpAddrWithoutRangeIdTest() throws Exception {
IpAddrRequest ipAddrRequest = buildIpAddrRequest();
ipAddrRequest.setRangeId(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the ip range selected deterministically or randomly, if more than more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sequentially

@xieus xieus added the unit test Unit test label Jul 1, 2020
@xieus xieus added this to the Version 0.6.2020.06.30 milestone Jul 1, 2020
@xieus xieus changed the title [Private IP Manager] Add some UTs to cover all interfaces of IpAddrRangeRepo [Private IP Manager] Add UTs to Cover IpAddrRangeRepo interfaces Jul 1, 2020
@xieus xieus merged commit 0b5c23d into futurewei-cloud:master Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

unit test Unit test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants