Fix CtsInstallHostTestCases
Test: atest CtsInstallHostTestCases
Bug: 189099101
Bug: 187864524
Change-Id: I7cf45e4a9cbbcc93df9c36fc17cfbd171b3eb97a
diff --git a/hostsidetests/install/app/src/android/cts/install/InstallTest.java b/hostsidetests/install/app/src/android/cts/install/InstallTest.java
index 5a5dd54..4d9d835 100644
--- a/hostsidetests/install/app/src/android/cts/install/InstallTest.java
+++ b/hostsidetests/install/app/src/android/cts/install/InstallTest.java
@@ -104,8 +104,17 @@
@Test
public void assert_commitFailure_phase() {
Install install = getParameterizedInstall(VERSION_CODE_TARGET);
- InstallUtils.commitExpectingFailure(IllegalArgumentException.class,
- "APEX files can only be installed as part of a staged session.", install);
+ if (mEnableRollback) {
+ InstallUtils.commitExpectingFailure(IllegalArgumentException.class,
+ "Non-staged APEX session doesn't support INSTALL_ENABLE_ROLLBACK", install);
+ } else if (mInstallType.equals(INSTALL_TYPE.SINGLE_APEX)) {
+ InstallUtils.commitExpectingFailure(AssertionError.class,
+ "does not support non-staged update", install);
+ } else {
+ InstallUtils.commitExpectingFailure(AssertionError.class,
+ "Non-staged multi package install of APEX and APK packages is not supported",
+ install);
+ }
}
@Test