Merge "Add test for [stop|start]VpnProfile()" into sc-dev

This commit is contained in:
Lucas Lin 2021-08-10 02:28:24 +00:00 • committed by Android (Google) Code Review
commit 2900ffbb5f

View file

@ -9546,6 +9546,19 @@ public class ConnectivityServiceTest {
assertContainsExactly(uidCaptor.getValue(), APP1_UID, APP2_UID);
}
@Test
public void testStartVpnProfileFromDiffPackage() throws Exception {
final String notMyVpnPkg = "com.not.my.vpn";
assertThrows(
SecurityException.class, () -> mVpnManagerService.startVpnProfile(notMyVpnPkg));
}
@Test
public void testStopVpnProfileFromDiffPackage() throws Exception {
final String notMyVpnPkg = "com.not.my.vpn";
assertThrows(SecurityException.class, () -> mVpnManagerService.stopVpnProfile(notMyVpnPkg));
}
@Test
public void testUidUpdateChangesInterfaceFilteringRule() throws Exception {
LinkProperties lp = new LinkProperties();