diff options
author | ludi <ludi@google.com> | 2017-11-15 14:05:16 -0800 |
---|---|---|
committer | ludi <ludi@google.com> | 2017-11-28 10:21:18 -0800 |
commit | 6b7fb6bbec42a74047e4f0bb472266e095a0f10e (patch) | |
tree | 27385898acdf6ba9a54d93f500bb9b84eadaf8c5 /tests/net/java/com/android/server/IpSecServiceTest.java | |
parent | e72b6f0d3113c84df6d9113609942ef5d9b4e34e (diff) |
Cleanup of resource limit tests
Test: runtest frameworks-net
Bug: 65688605
Change-Id: Ice3ff2624b83c833a99559485c1e782d36c54ae3
Diffstat (limited to 'tests/net/java/com/android/server/IpSecServiceTest.java')
-rw-r--r-- | tests/net/java/com/android/server/IpSecServiceTest.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/net/java/com/android/server/IpSecServiceTest.java b/tests/net/java/com/android/server/IpSecServiceTest.java index 8e579aa68eae..0720886f8816 100644 --- a/tests/net/java/com/android/server/IpSecServiceTest.java +++ b/tests/net/java/com/android/server/IpSecServiceTest.java @@ -270,8 +270,8 @@ public class IpSecServiceTest { } /** - * This function checks if the number of encap UDP socket that one UID can reserve - * has a reasonable limit. + * This function checks if the number of encap UDP socket that one UID can reserve has a + * reasonable limit. */ @Test public void testSocketResourceTrackerLimitation() throws Exception { @@ -287,9 +287,10 @@ public class IpSecServiceTest { openUdpEncapSockets.add(newUdpEncapSocket); } // Assert that the total sockets quota has a reasonable limit. + assertTrue("No UDP encap socket was open", !openUdpEncapSockets.isEmpty()); assertTrue( - openUdpEncapSockets.size() > 0 - && openUdpEncapSockets.size() < MAX_NUM_ENCAP_SOCKETS); + "Number of open UDP encap sockets is out of bound", + openUdpEncapSockets.size() < MAX_NUM_ENCAP_SOCKETS); // Try to reserve one more UDP encapsulation socket, and should fail. IpSecUdpEncapResponse extraUdpEncapSocket = @@ -297,7 +298,7 @@ public class IpSecServiceTest { assertNotNull(extraUdpEncapSocket); assertEquals(IpSecManager.Status.RESOURCE_UNAVAILABLE, extraUdpEncapSocket.status); - // Close one of the open UDP encapsulation scokets. + // Close one of the open UDP encapsulation sockets. mIpSecService.closeUdpEncapsulationSocket(openUdpEncapSockets.get(0).resourceId); openUdpEncapSockets.get(0).fileDescriptor.close(); openUdpEncapSockets.remove(0); @@ -316,10 +317,9 @@ public class IpSecServiceTest { } /** - * This function checks if the number of SPI that one UID can reserve - * has a reasonable limit. - * This test does not test for both address families or duplicate SPIs because resource - * tracking code does not depend on them. + * This function checks if the number of SPI that one UID can reserve has a reasonable limit. + * This test does not test for both address families or duplicate SPIs because resource tracking + * code does not depend on them. */ @Test public void testSpiResourceTrackerLimitation() throws Exception { |