summaryrefslogtreecommitdiff
path: root/tests/unit/java/com/android/server/connectivity/VpnTest.java
Commit message (Collapse)AuthorAgeFilesLines
* Update test on calling getAppExclusionList with restricted userchiachangwang2022-09-221-1/+2
| | | | | | | | Bug: 247344442 Test: atest VpnTest Change-Id: I3b847f13162f8702013b23cabefce8d98b62f5c6 (cherry picked from commit 8dae9343bbaa5a27324c424dbfddb7a354db2d92) Merged-In: I3b847f13162f8702013b23cabefce8d98b62f5c6
* Update the prefix of VPN_APP_EXCLUDED in the testchiachangwang2022-08-181-1/+1
| | | | | | | | | | Update the string according to the change in Vpn.java Bug: 237345836 Test: atest FrameworksNetTests Change-Id: I9bfe0a1fad29ba1435eeb8b8b2cffa9d385b1cb5 (cherry picked from commit 9460f45c047e49aff7e83ea3496476dd21752e0e) Merged-In: I9bfe0a1fad29ba1435eeb8b8b2cffa9d385b1cb5
* Test that VpnManager events will never be sent to Settings VPNslucaslin2022-07-271-0/+25
| | | | | | | | | | | This change tries to mock there is an IkeTimeoutException when Settings VPN is establishing connection and see if the VpnManager events will be sent to Settings VPN or not. Bug: 236315805 Test: atest FrameworksNetTests:VpnTest Change-Id: I1706ceb129ef95f44d45754665b9dbcf9b6fdfd4 Merged-In: I0ee4a70ded4937a1573d34cddab552f762e4fc18
* Add test for startPptpRemi NGUYEN VAN2022-07-131-0/+53
| | | | | | | | | | | The test verifies arguments used to start the daemon Bug: 201660636 Test: atest VpnTest Change-Id: I0854fbeaf1a3e3554c157fde227a7bfa187b1013 Merged-In: I0854fbeaf1a3e3554c157fde227a7bfa187b1013 (cherry picked from commit 522cea7d4eca8b0c80b78fa187e6b0f24e10994d) Merged-In: I0854fbeaf1a3e3554c157fde227a7bfa187b1013
* Test recoverable Ikev2 errorslucaslin2022-06-101-7/+30
| | | | | | | | | | | Test if retry mechanism is working or not when there is a recoverable Ikev2 error. Bug: 229350078 Test: atest FrameworksNetTests:VpnTest Change-Id: I5e881c6b42aeb98adce598587e2a7e49be7d9643 (cherry picked from commit adb56e94a5fc3c61af10780713f0b7a4f163c965) Merged-In: I5e881c6b42aeb98adce598587e2a7e49be7d9643
* Verify if the VPN app has been added into power save whilte listlucaslin2022-06-031-1/+34
| | | | | | | | Bug: 234104087 Test: atest FrameworksNetTests:VpnTest Change-Id: I2aa99b8ea8dbe668a45782f50a4a0ac82e72b7a2 (cherry picked from commit 802fa5d0ec0642573951e93e7106f3b809ac4aff) Merged-In: I2aa99b8ea8dbe668a45782f50a4a0ac82e72b7a2
* Test VpnManager event for CATEGORY_EVENT_NETWORK_ERRORlucaslin2022-05-281-6/+53
| | | | | | | | Bug: 191413541 Test: atest FrameworksNetTests:VpnTest Change-Id: Idffd5f5f8fc6614281f3fb0884228a797d783fe3 (cherry picked from commit cfec723ef9b7b82586192ee106e0efab52640bc0) Merged-In: Idffd5f5f8fc6614281f3fb0884228a797d783fe3
* Test VpnManager event for CATEGORY_EVENT_IKE_ERRORlucaslin2022-05-281-9/+33
| | | | | | | | Bug: 191413541 Test: atest FrameworksNetTests:VpnTest Change-Id: Iebc0ac281eb03fac9626c64e44cdd14be1462d89 (cherry picked from commit 827b44daeaec3298429d4e031839e55b864c4bb3) Merged-In: Iebc0ac281eb03fac9626c64e44cdd14be1462d89
* Test VpnManager event for CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGEDlucaslin2022-05-231-13/+82
| | | | | | | | Bug: 225010642 Test: atest FrameworksNetTests:VpnTest Change-Id: I078be4e00470efd9d7a2a87b40919116b99c83b8 (cherry picked from commit 0772c169b59e0536a68486a921f9144c5732faff) Merged-In: I078be4e00470efd9d7a2a87b40919116b99c83b8
* Test VpnManager event for CATEGORY_EVENT_DEACTIVATED_BY_USERlucaslin2022-05-231-27/+92
| | | | | | | | Bug: 191413541 Test: atest FrameworksNetTests:VpnTest Change-Id: Idc876275b88c2f4ddeb85c43d37d5f657b0f307b (cherry picked from commit c5bf088ced4c729c5a11c4d29e2c0bb9077a4c14) Merged-In: Idc876275b88c2f4ddeb85c43d37d5f657b0f307b
* Address leftover commentsChiachang2022-05-131-21/+27
| | | | | | | | | | | | | | This is a follow-up commit from aosp/2076483. Mainly to update: 1. Update the hex string to human understandable code instead of byte code. 2. Use IgnoreUpTo() to do the SDK check 3. Avoid relying on the code being tested Bug: 192078259 Test: atest FrameworksNetTests Change-Id: I8973d248a1d30fdcb597677dbf051e146041f905 (cherry picked from commit a023f88193c62b78afc0508865c8961863c9efda) Merged-In: I8973d248a1d30fdcb597677dbf051e146041f905
* Test [set|get]AppExclusionListchiachangwang2022-05-131-0/+60
| | | | | | | | Bug: 192078259 Test: atest FrameworksNetTests Change-Id: Iee81d84b4127420121ce2d5a7defc3dbe34b6cde (cherry picked from commit 218d5652de980cb2834468725e4b5999f0373582) Merged-In: Iee81d84b4127420121ce2d5a7defc3dbe34b6cde
* Modify VPN unit tests to include SDK sandbox UIDs.Martijn Coenen2022-05-121-19/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | VPN configurations in T should automatically include the corresponding SDK sandbox UID of an application. The existing tests used a UID range outside the regular application range, which means the new sandbox UIDs wouldn't be tested. Modified the UIDs to run in the regular UID range of [10000, 19999]. Changed the tests to include the SDK sandbox UID where necessary. Also, changed the entire class to only run on T+, since that is the only place where the SDK sandbox UIDs will be added. Since VPN code is not mainline updatable, having coverage on earlier releases doesn't really help anyway. Finally, fixed up testNetworkBlockedStatusAlwaysOnVpn() in ConnectivityServiceTest, and only have that run on T+ for the same reasons. Bug: 225317905 Test: atest VpnTest Test: atest ConnectivityServiceTest Change-Id: I83009344c270e520ac8ad1558c067cf7e46b1d2e Merged-In: I83009344c270e520ac8ad1558c067cf7e46b1d2e
* Add test for Vpn#prepare()lucaslin2021-12-221-0/+32
| | | | | | | | | | | | Add test for Vpn#prepare() to check if the SecurityException will be thrown when the caller is not the SYSTEM_UID and doesn't have CONTROL_VPN permission and its package doesn't match the oldPackage or the newPackage. Ignore-AOSP-First: It's a part of security patches. Bug: 191276656 Test: atest FrameworksNetTests:VpnTest Change-Id: Ibe0b245561b00442a6377fb849603f8b9026e9c4
* Add tests for testing if [start|finish]Op is called or notlucaslin2021-10-261-0/+108
| | | | | | | | | | | Add a test for testing if [start|finish]Op will be called when [start|stop]VpnProfile is called. Also add a test to ensure that the startOp will not be called again when seamless handover is happened. Bug: 197135981 Test: atest FrameworksNetTests:VpnTest Change-Id: I778ea4edf7c4a2d20b3b8e1877e7942feac5372a
* Re-skip connectivity unit tests before SRemi NGUYEN VAN2021-06-301-2/+4
| | | | | | | | | | | | | | | | | | The tests are packaged together with other tests in a common coverage suite, so need to be individually annotated so that they are skipped before S. They do not need to pass on platforms older than S, because such platforms will not updated with the code that is tested. This applies a previous change, this time using DevSdkIgnoreRunner, as SdkSuppress does not work as expected in branches that have a codename 2 versions above the SDK version, as is the case in AOSP. Bug: 187935317 Test: atest ConnectivityCoverageTests on R atest FrameworksNetTests on S Change-Id: I5808d34459a4c19238baf8873afa7cf942828460
* Revert "Skip connectivity unit tests before S"Remi NGUYEN VAN2021-06-291-3/+0
| | | | | | | | | This reverts commit 05dd1ba54005b15d92daf6f26329acf91fb3debb. Reason for revert: Skips more tests than it should in AOSP Bug: 192302892 Change-Id: I7c5638d8c1cc626354d240a06af758e1cdd92e94
* Skip connectivity unit tests before SRemi NGUYEN VAN2021-06-251-0/+3
| | | | | | | | | | | | | The tests are packaged together with other tests in a common coverage suite, so need to be individually annotated so that they are skipped before S. They do not need to pass on platforms older than S, because such platforms will not updated with the code that is tested. Bug: 187935317 Test: atest ConnectivityCoverageTests on R Change-Id: I10da45ae023e7f1e8cd11ec857b84346892a3fa8
* Make tests compatible with mockito-extendedRemi NGUYEN VAN2021-06-161-13/+16
| | | | | | | | | | | | | | | | | | | This does not change the mockito library to use mockito-extended in FrameworksNetTests, but changes the tests so that they would pass if built against that library. This is useful to run FrameworksNetTests in a common test suite with other tests that use mockito-extended, for example a common connectivity coverage test target. The change includes increasing the test timeout in ConnectivityServiceTest, as mockito-extended can have performance impact (~3 times on hwasan builds). This change does not make tests run slower in the current FrameworksNetTests suite though. Bug: 187935317 Test: atest FrameworksNetTests Change-Id: I61fa371e8957037075a2617a014647ff062207c6
* Revert "Use mockito-extended in FrameworksNetTests"xingdai2021-06-101-11/+13
| | | | | | | | | | This reverts commit 98b76cc2ec58396c804a4e4f658c915b3c80c138. Reason for revert: <INSERT REASONING HERE> b/190622577 Change-Id: Ief39f82875e6fa885829aea62eed00f2f2e6774e
* Use mockito-extended in FrameworksNetTestsRemi NGUYEN VAN2021-06-081-13/+11
| | | | | | | | | | This is necessary to mock classes like BatteryStatsManager, which cannot be used without signature permissions, and to merge the test with other test suites that use mockito extended. Bug: 187935317 Test: atest FrameworksNetTests Change-Id: I5dba65d806c5d06b3ff8f633846edb911a7a44ec
* Move net unit tests to packages/ConnectivityRemi NGUYEN VAN2021-05-131-0/+1283
Move the tests together with packages/Connectivity code, so both can be moved to packages/modules/Connectivity together. Also reorganize unit tests in a unit/ directory, as other tests (integration/, common/ etc.) have been added in tests/net since they were created. This makes the directory structure consistent. Test: atest FrameworksNetTests Bug: 187814163 Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc