commit | 28836849254e2c382b80bc80caf3d2a23c21247f | [log] [tgz] |
---|---|---|
author | Lucas Lin <lucaslin@google.com> | Tue Aug 10 02:55:36 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Aug 10 02:55:36 2021 +0000 |
tree | f54f5a1702a8fe3d9c3dce7d4f85c826e7ae4887 | |
parent | 54ecd83b7ea8ef407669498875eec3bfe4c270d8 [diff] | |
parent | 849c3fb997b08a3213c54fd35e4cfe59d79c59c1 [diff] |
Merge "Add test for [stop|start]VpnProfile()" into sc-dev am: 2900ffbb5f am: 849c3fb997 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15359731 Change-Id: I8a0f348953405ee38358739525fa9825cd3e0670
diff --git a/tests/unit/java/com/android/server/ConnectivityServiceTest.java b/tests/unit/java/com/android/server/ConnectivityServiceTest.java index 9dde31a..10b7e14 100644 --- a/tests/unit/java/com/android/server/ConnectivityServiceTest.java +++ b/tests/unit/java/com/android/server/ConnectivityServiceTest.java
@@ -9547,6 +9547,19 @@ } @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(); lp.setInterfaceName("tun0");