Merge "Use consistent naming for allocating SPI."

This commit is contained in:
nharold
2017-12-14 21:10:16 +00:00
committed by Gerrit Code Review
3 changed files with 18 additions and 16 deletions

View File

@@ -125,7 +125,7 @@ public class IpSecServiceParameterizedTest {
.thenReturn(TEST_SPI_OUT);
IpSecSpiResponse spiResp =
mIpSecService.reserveSecurityParameterIndex(
mIpSecService.allocateSecurityParameterIndex(
IpSecTransform.DIRECTION_OUT, mRemoteAddr, TEST_SPI_OUT, new Binder());
assertEquals(IpSecManager.Status.OK, spiResp.status);
assertEquals(TEST_SPI_OUT, spiResp.spi);
@@ -142,7 +142,7 @@ public class IpSecServiceParameterizedTest {
.thenReturn(TEST_SPI_OUT);
IpSecSpiResponse spiResp =
mIpSecService.reserveSecurityParameterIndex(
mIpSecService.allocateSecurityParameterIndex(
IpSecTransform.DIRECTION_OUT, mRemoteAddr, TEST_SPI_OUT, new Binder());
mIpSecService.releaseSecurityParameterIndex(spiResp.resourceId);
@@ -212,7 +212,7 @@ public class IpSecServiceParameterizedTest {
.thenReturn(returnSpi);
IpSecSpiResponse spi =
mIpSecService.reserveSecurityParameterIndex(
mIpSecService.allocateSecurityParameterIndex(
direction,
NetworkUtils.numericToInetAddress(remoteAddress).getHostAddress(),
IpSecManager.INVALID_SECURITY_PARAMETER_INDEX,

View File

@@ -287,7 +287,7 @@ public class IpSecServiceTest {
for (String address : invalidAddresses) {
try {
IpSecSpiResponse spiResp =
mIpSecService.reserveSecurityParameterIndex(
mIpSecService.allocateSecurityParameterIndex(
IpSecTransform.DIRECTION_OUT, address, DROID_SPI, new Binder());
fail("Invalid address was passed through IpSecService validation: " + address);
} catch (IllegalArgumentException e) {
@@ -368,7 +368,7 @@ public class IpSecServiceTest {
// Reserve spis until it fails.
for (int i = 0; i < MAX_NUM_SPIS; i++) {
IpSecSpiResponse newSpi =
mIpSecService.reserveSecurityParameterIndex(
mIpSecService.allocateSecurityParameterIndex(
0x1,
InetAddress.getLoopbackAddress().getHostAddress(),
DROID_SPI + i,
@@ -384,7 +384,7 @@ public class IpSecServiceTest {
// Try to reserve one more SPI, and should fail.
IpSecSpiResponse extraSpi =
mIpSecService.reserveSecurityParameterIndex(
mIpSecService.allocateSecurityParameterIndex(
0x1,
InetAddress.getLoopbackAddress().getHostAddress(),
DROID_SPI + MAX_NUM_SPIS,
@@ -398,7 +398,7 @@ public class IpSecServiceTest {
// Should successfully reserve one more spi.
extraSpi =
mIpSecService.reserveSecurityParameterIndex(
mIpSecService.allocateSecurityParameterIndex(
0x1,
InetAddress.getLoopbackAddress().getHostAddress(),
DROID_SPI + MAX_NUM_SPIS,