| commit | 678ed28744dd8e4476489125dc98f83df3a610c1 | [log] [tgz] |
|---|---|---|
| author | Hai Zhang <zhanghai@google.com> | Tue Jul 02 22:16:41 2024 +0000 |
| committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Jul 04 03:15:54 2024 +0000 |
| tree | 7c95ce98f8b951167ef9da53fbd69d0957850198 | |
| parent | 24aec7d4f2f28d41e88f305a741d5b33c3bb95db [diff] |
Fix CtsRootPermissionTestCases NoSuchMethodError before U. We fixed the test issue on U by skipping it when SdkLevel.isAtLeastV() returns false. However, despite that the SdkLevel is a class bundled in a static library for our testcase APK, our test is instrumenting against the system server which has its own copy of SdkLevel with a higher priority in default class loading, and that copy could be stale on older platforms so we are seeing the NoSuchMethodError. Instead of trying to fight with class loading, a simpler and more reliable way is to use @SdkSuppress instead. This also adds the explicit numeric SDK versions for the test helper apps so that an in-development W version of the test won't fail on stable V platform in the future. Bug: 348576508 Flag: TEST_ONLY Test: m gts && gts-tradefed run gts-root -m CtsRootPermissionTestCases Test: on R/S/V platforms (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2f0f363de37e6db91dac89646c121bb4c1de91d1) Merged-In: I887e6456d4b48edb2994d5059772cbf9fcb94bc4 Change-Id: I887e6456d4b48edb2994d5059772cbf9fcb94bc4
This is an extension the main CTS test suite, for general compatibility tests that require root privileges or a debuggable device.
Note that the name of this suite in the build system is CTS_ROOT (with an underscore), so this is built with m cts_root and tests must be tagged with cts_root in their test_suites to be included.
However in tradefed the name is cts-root (with a hyphen), so use cts-root-tradefed to run it, and run cts-root to run the default cts-root plan.