Enable pKVM before running tests
Some devices need pKVM to be enabled in fastboot before the pKVM tests
run. Add preparation stages to the appropriate tests to first enable
pKVM and then do back to the default afterwards.
Bug: 192819132
Test: atest AuthFsHostTest ComposHostTestCases MicrodroidHostTestCases
Change-Id: Ie998ba2a839978977087d4aa6eed7bcfa230a01c
diff --git a/authfs/tests/AndroidTest.xml b/authfs/tests/AndroidTest.xml
index 6100ab9..edfec78 100644
--- a/authfs/tests/AndroidTest.xml
+++ b/authfs/tests/AndroidTest.xml
@@ -15,6 +15,9 @@
-->
<configuration description="Config for authfs tests">
+ <!-- Make sure pKVM is available on the device -->
+ <target_preparer class="com.android.tradefed.targetprep.PkvmPreparer"/>
+
<!-- Need root to start virtualizationservice -->
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
diff --git a/compos/tests/AndroidTest.xml b/compos/tests/AndroidTest.xml
index 61b6d47..3331705 100644
--- a/compos/tests/AndroidTest.xml
+++ b/compos/tests/AndroidTest.xml
@@ -14,6 +14,9 @@
limitations under the License.
-->
<configuration description="Tests for CompOS">
+ <!-- Make sure pKVM is available on the device -->
+ <target_preparer class="com.android.tradefed.targetprep.PkvmPreparer"/>
+
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
<option name="force-root" value="true" />
</target_preparer>
diff --git a/tests/hostside/AndroidTest.xml b/tests/hostside/AndroidTest.xml
index e8aced6..99157e0 100644
--- a/tests/hostside/AndroidTest.xml
+++ b/tests/hostside/AndroidTest.xml
@@ -14,6 +14,9 @@
limitations under the License.
-->
<configuration description="Tests for microdroid">
+ <!-- Make sure pKVM is available on the device -->
+ <target_preparer class="com.android.tradefed.targetprep.PkvmPreparer"/>
+
<test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
<option name="jar" value="MicrodroidHostTestCases.jar" />
</test>