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

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15359731

Change-Id: Ieb3774e45cacb9c9e2e3ebea1ba55c757d2679e8
This commit is contained in:
Lucas Lin
2021-08-10 02:38:50 +00:00
committed by Automerger Merge Worker

View File

@@ -9548,6 +9548,19 @@ public class ConnectivityServiceTest {
assertContainsExactly(uidCaptor.getValue(), APP1_UID, APP2_UID); 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 @Test
public void testUidUpdateChangesInterfaceFilteringRule() throws Exception { public void testUidUpdateChangesInterfaceFilteringRule() throws Exception {
LinkProperties lp = new LinkProperties(); LinkProperties lp = new LinkProperties();