Merge "[test] Add e2e test skeleton for kernel image verification in pvmfw"
diff --git a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
index 11b3e84..231fc7b 100644
--- a/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
+++ b/tests/hostside/java/com/android/microdroid/test/MicrodroidHostTests.java
@@ -407,20 +407,26 @@
}
@Test
- @Ignore("b/245081929")
@CddTest(requirements = {"9.17/C-2-1", "9.17/C-2-2", "9.17/C-2-6"})
- public void testBootFailsWhenProtectedVmStartsWithImagesSignedWithDifferentKey()
- throws Exception {
+ public void protectedVmWithImageSignedWithDifferentKeyRunsPvmfw() throws Exception {
+ // Arrange
boolean protectedVm = true;
assumeTrue(
"Skip if protected VMs are not supported",
getAndroidDevice().supportsMicrodroid(protectedVm));
-
File key = findTestFile("test.com.android.virt.pem");
- Map<String, File> keyOverrides = Map.of();
- VmInfo vmInfo = runMicrodroidWithResignedImages(key, keyOverrides, protectedVm);
+
+ // Act
+ VmInfo vmInfo =
+ runMicrodroidWithResignedImages(key, /*keyOverrides=*/ Map.of(), protectedVm);
+
+ // Asserts
vmInfo.mProcess.waitFor(5L, TimeUnit.SECONDS);
- assertThat(getDevice().pullFileContents(CONSOLE_PATH), containsString("pvmfw boot failed"));
+ String consoleLog = getDevice().pullFileContents(CONSOLE_PATH);
+ assertWithMessage("pvmfw should start").that(consoleLog).contains("pVM firmware");
+ // TODO(b/256148034): Asserts that pvmfw run fails when this verification is implemented.
+ // Also rename the test.
+ vmInfo.mProcess.destroy();
}
// TODO(b/245277660): Resigning the system/vendor image changes the vbmeta hash.