Merge "Return a port from bindToPort() in IpSecService" am: 51de41dea2
am: 0d4a1ae642
Change-Id: Ie59d496a38bf9775c1f40a543a24cb3fec5719bf
This commit is contained in:
@@ -21,6 +21,7 @@ import static android.system.OsConstants.EADDRINUSE;
|
|||||||
import static android.system.OsConstants.IPPROTO_UDP;
|
import static android.system.OsConstants.IPPROTO_UDP;
|
||||||
import static android.system.OsConstants.SOCK_DGRAM;
|
import static android.system.OsConstants.SOCK_DGRAM;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
@@ -174,6 +175,7 @@ public class IpSecServiceTest {
|
|||||||
mIpSecService.openUdpEncapsulationSocket(0, new Binder());
|
mIpSecService.openUdpEncapsulationSocket(0, new Binder());
|
||||||
assertNotNull(udpEncapResp);
|
assertNotNull(udpEncapResp);
|
||||||
assertEquals(IpSecManager.Status.OK, udpEncapResp.status);
|
assertEquals(IpSecManager.Status.OK, udpEncapResp.status);
|
||||||
|
assertNotEquals(0, udpEncapResp.port);
|
||||||
mIpSecService.closeUdpEncapsulationSocket(udpEncapResp.resourceId);
|
mIpSecService.closeUdpEncapsulationSocket(udpEncapResp.resourceId);
|
||||||
udpEncapResp.fileDescriptor.close();
|
udpEncapResp.fileDescriptor.close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user