diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-10-13 02:24:35 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-10-13 02:24:35 +0000 |
commit | 7f030d9cecc80f43ada317cf375c38974f05c18f (patch) | |
tree | 6935830a6c8c03c1b9464fb8a8dcb2beea14083b | |
parent | 766441132e667ab430c12508778b3c3de2d4b5ab (diff) | |
parent | 74fa29e357565d207e7f6ce278a2615a4ab5964d (diff) | |
download | cts-7f030d9cecc80f43ada317cf375c38974f05c18f.tar.gz |
Merge "Don't assume incremental fs exists on R launch devices" into android14-tests-dev am: 5f9e039072 am: dadd7dcbed am: 74fa29e357
Original change: https://android-review.googlesource.com/c/platform/cts/+/2782338
Change-Id: I021ec64637963c1a68471675dc6339a93e2dea81
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalFeatureTest.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalFeatureTest.java b/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalFeatureTest.java index a83705956c3..6e74b377bc2 100644 --- a/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalFeatureTest.java +++ b/hostsidetests/incrementalinstall/src/android/incrementalinstall/cts/IncrementalFeatureTest.java @@ -48,15 +48,20 @@ public class IncrementalFeatureTest extends BaseHostJUnit4Test { @Before public void setUp() throws Exception { - // Test devices that are launched with R and above; ignore non-targeted devices - assumeTrue(getDevice().getLaunchApiLevel() >= 30 /* Build.VERSION_CODES.R */); + int launchApiLevel = getDevice().getLaunchApiLevel(); + + // Devices that launched with R may fail GSI testing if they have incfs built into the + // kernel. + // Test R devices that report the feature. + // Test all devices S and above. + assumeTrue((launchApiLevel == 30 && featureAvailable()) + || launchApiLevel > 30); } @CddTest(requirement="4/C-1-1") @Test public void testFeatureAvailable() throws Exception { - assertTrue("true\n".equals(getDevice().executeShellCommand( - "pm has-feature android.software.incremental_delivery"))); + assertTrue(featureAvailable()); } @CddTest(requirement="4/C-1-1,C-3-1") @@ -78,4 +83,9 @@ public class IncrementalFeatureTest extends BaseHostJUnit4Test { assertTrue(getDevice().isPackageInstalled(TEST_APP_PACKAGE_NAME)); getDevice().uninstallPackage(TEST_APP_PACKAGE_NAME); } + + private boolean featureAvailable() throws Exception { + return "true\n".equals(getDevice().executeShellCommand( + "pm has-feature android.software.incremental_delivery")); + } } |