Skip changingDebuggability related tests on Non-pVM
These are boot tests (more precisely, they test that VM does not boot)
when debuggability is changed. Debuggability changes the initrd which is
verified by pvmfw. They dont make much sense in cases of non-protected
VM where pvmfw is not in boot seq.
Note: the test still pass for non-protected VM on devices without debug
policy, the reason for that is an extra apex 'adbd' is included in the
VM, which results in MicrodroidData 'mismatch' result in boot failure.
But that is not the point of the test.
Bug: 301014052
Test: atest #changingNonDebuggableVmDebuggableInvalidatesVmIdentity &
check that it is indeed skipped
Merged-In: Ic2818a8f513c778ad1f5217d3641398c8df1719d
Change-Id: Ic2818a8f513c778ad1f5217d3641398c8df1719d
(cherry picked from commit 2174d411d3735e03e00bfa4650db4795cc595545)
diff --git a/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java b/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java
index 4e1d238..ed92708 100644
--- a/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java
+++ b/tests/helper/src/java/com/android/microdroid/test/device/MicrodroidDeviceTestBase.java
@@ -558,4 +558,8 @@
protected interface RunTestsAgainstTestService {
void runTests(ITestService testService, TestResults testResults) throws Exception;
}
+
+ protected void assumeProtectedVM() {
+ assumeTrue("Skip on non-protected VM", mProtectedVm);
+ }
}
diff --git a/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java b/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java
index 8303791..028e54c 100644
--- a/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java
+++ b/tests/testapk/src/java/com/android/microdroid/test/MicrodroidTests.java
@@ -928,12 +928,18 @@
@Test
@CddTest(requirements = {"9.17/C-1-1", "9.17/C-2-7"})
public void changingNonDebuggableVmDebuggableInvalidatesVmIdentity() throws Exception {
+ // Debuggability changes initrd which is verified by pvmfw.
+ // Therefore, skip this on non-protected VM.
+ assumeProtectedVM();
changeDebugLevel(DEBUG_LEVEL_NONE, DEBUG_LEVEL_FULL);
}
@Test
@CddTest(requirements = {"9.17/C-1-1", "9.17/C-2-7"})
public void changingDebuggableVmNonDebuggableInvalidatesVmIdentity() throws Exception {
+ // Debuggability changes initrd which is verified by pvmfw.
+ // Therefore, skip this on non-protected VM.
+ assumeProtectedVM();
changeDebugLevel(DEBUG_LEVEL_FULL, DEBUG_LEVEL_NONE);
}