blob: a58c08c095f4712847437dfadc6ef0268486b481 [file] [log] [blame]
David Brazdil1267a282020-10-15 12:33:20 +00001<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2020 The Android Open Source Project
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15-->
16
David Brazdil49f8a4d2021-03-04 09:57:33 +000017<configuration description="Config for Virtualization tests">
Jiyong Park360d8a72021-06-08 13:19:20 +090018 <!-- virtualizationservice doesn't have access to shell_data_file. Instead of giving it
19 a test-only permission, run it without selinux -->
20 <target_preparer class="com.android.tradefed.targetprep.DisableSELinuxTargetPreparer"/>
David Brazdil1267a282020-10-15 12:33:20 +000021
22 <!-- Basic checks that the device has all the prerequisites. -->
23 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
24 <option name="throw-if-cmd-fail" value="true" />
25 <!-- Kernel has KVM enabled. -->
26 <option name="run-command" value="ls /dev/kvm" />
27 <!-- Kernel has vhost-vsock enabled. -->
28 <option name="run-command" value="ls /dev/vhost-vsock" />
29 <!-- CrosVM is installed. -->
Andrew Walbran3049fdf2020-12-23 12:46:30 +000030 <option name="run-command" value="ls /apex/com.android.virt/bin/crosvm" />
Andrew Walbranf6bf6862021-05-21 12:41:13 +000031 <!-- VirtualizationService is installed. -->
32 <option name="run-command" value="ls /apex/com.android.virt/bin/virtualizationservice" />
David Brazdil1267a282020-10-15 12:33:20 +000033 </target_preparer>
34
35 <!-- Push test binaries to the device. -->
36 <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
37 <option name="cleanup" value="true" />
38 <option name="abort-on-push-failure" value="true" />
David Brazdil49f8a4d2021-03-04 09:57:33 +000039 <option name="push-file" key="VirtualizationTestCases" value="/data/local/tmp/virt-test/VirtualizationTestCases" />
40 <option name="push-file" key="virt_test_kernel" value="/data/local/tmp/virt-test/kernel" />
41 <option name="push-file" key="virt_test_initramfs.img" value="/data/local/tmp/virt-test/initramfs" />
David Brazdil1267a282020-10-15 12:33:20 +000042 </target_preparer>
43
44 <!-- Root currently needed to run CrosVM.
45 TODO: Give sufficient permissions to the adb shell user (b/171240450). -->
46 <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
47
Andrew Walbranf6bf6862021-05-21 12:41:13 +000048 <!-- Run VirtualizationService for the duration of the test.
49 TODO: Run VirtualizationService as a system service. -->
David Brazdil49f8a4d2021-03-04 09:57:33 +000050 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
51 <option name="throw-if-cmd-fail" value="true" />
Andrew Walbranf6bf6862021-05-21 12:41:13 +000052 <option name="run-command" value="start virtualizationservice" />
David Brazdil49f8a4d2021-03-04 09:57:33 +000053 </target_preparer>
54
55 <test class="com.android.tradefed.testtype.GTest" >
56 <option name="native-test-device-path" value="/data/local/tmp/virt-test" />
57 <option name="module-name" value="VirtualizationTestCases" />
58 <!-- test-timeout unit is ms, value = 2 minutes -->
59 <option name="native-test-timeout" value="120000" />
David Brazdil1267a282020-10-15 12:33:20 +000060 </test>
61</configuration>