summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/LinkPropertiesTest.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix LinkProperties exclude routes tests on user builds.Lorenzo Colitti2022-06-131-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests fail on user builds because they target T and attempt to override the compat change, which is not allowed on user builds because the change defaults to on for apps targeting T+. Fix this by marking the tests max target SDK 31. Also improve the tests a bit: - Use a RuleChain to make it explicit that CtsNetTestCasesMaxTargetSdk31 should be evaluated before EnableCompatChanges (otherwise the compat change rule would crash on user builds even if the max target SDK rule was going to skip the test anyway). - Fix the IgnoreUpTo for all exclude route tests to say S+. Currently: - One says R+, which is incorrect because the updated LinkProperties code is in the connectivity module, which only goes back to S, not R. - The others say T+, which is incorrect because the update code is present on S. Fix: 233553525 Test: LinkProperties test in CtsNetTestCasesLatestSdk passes on T user build Test: LinkProperties test in CtsNetTestCasesMaxTargetSdk31 passes on T user build Change-Id: Ie0e2f6761b90a65813ed3610c7b5e930a9fdc982 (cherry picked from commit 1bb94a34909912a449e0b719b6ddd5b8aa4a9f7d) Merged-In: Ie0e2f6761b90a65813ed3610c7b5e930a9fdc982
* Run testExcludedRoutesDisabled only in APKs with target SDK < T.Lorenzo Colitti2022-06-011-0/+2
| | | | | | | | | | | | | | | This test crashes if run from an APK that has target SDK 33 or above because it tries to disable a compat change that on those SDK versions is enabled by default. Run it only in CtsNetTestCasesMaxTargetSdk31 and skip it in our regular CTS modules. Bug: 233553525 Test: test-only change Change-Id: Iaf9c46591c13505c9d2a2a09994b9ee22a22390c (cherry picked from commit 1c7a20c6c697ed4ad6ff08c9cc45131e90ede514) Merged-In: Iaf9c46591c13505c9d2a2a09994b9ee22a22390c
* Follow-up changes to Update VPN isolation code for excluded routespreranap2022-05-131-3/+4
| | | | | | | | | | Making changes in the hasExcludeRoute() with more realistic values as suggested in CL 18173562(https://googleplex-android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/18173562) by Lorenzo Bug: 230058738 Test: atest LinkPropertiesTest Change-Id: Ic0ea1e83fbe5bfec98b0060ba1a9635d5ba710e1 Merged-In: Ic0ea1e83fbe5bfec98b0060ba1a9635d5ba710e1
* Update VPN isolation code for excluded routesPrerana2022-05-061-0/+11
| | | | | | | | | | | Bug: 230058738 Test: atest LinkPropertiesTest Result: https://paste.googleplex.com/4706859672928256 Change-Id: I970fca6b0e2cd358e9bd77152563d13367867c74 (cherry picked from commit 2b97bbebf4b85e0024fc75298e760fc03516be40) Merged-In: I970fca6b0e2cd358e9bd77152563d13367867c74
* Filter out excluded routes in LinkPropertiesTaras Antoshchuk2022-04-131-0/+41
| | | | | | | | Gate presence of excluded routes in LinkProperties on target sdk T. Bug: 186082280 Test: atest LinkPropertiesTest Change-Id: If8fdb468a0a4968c5f2a878b7aacfeb4f7d9a9e5
* Mark connectivity module tests as suchRemi NGUYEN VAN2022-01-181-0/+2
| | | | | | | | | | | | | | | | Add @ConnectivityModuleTest to tests for classes that are mainly used to back the connectivity (tethering) module, in particular data classes. This causes the test not to be run in NetworkStack/CaptivePortalLogin MTS tests when the connectivity (tethering) module is not installed. Skipping such tests is necessary in that configuration as they may test behavior that is new in the latest update, and data classes backing the connectivity module would not be affected by NetworkStack/CaptivePortalLogin updates anyway. Bug: 211075897 Test: atest CtsNetTestCasesLatestSdk Change-Id: I6163cd998fc78765b903fdb7acd21e652bc711c9
* Do not verify field count in tests used in CTSRemi NGUYEN VAN2022-01-181-4/+2
| | | | | | | | | | | | | | | | | Tests in tests/common and tests/cts are run as part of CtsNetTestCases. Many used assertFieldCountEquals in parceling/unparceling tests to ensure that unexpected fields were not added, or that they were not missed when testing parceling/unparceling. However with many of the classes updatable through module updates, the field count may change in the future, breaking CTS tests. Stop checking for the field count, as it would break on module releases, and its value is lower than the maintenance cost. Bug: 205901761 Test: atest CtsNetTestCases Change-Id: I79854741f7e834574d4825bb737ef507785310fe
* Move net unit tests to packages/ConnectivityRemi NGUYEN VAN2021-05-131-0/+1271
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