Add our integration tests to cts
Note: per_testcase_directory: true is added to the two tests sharing
MicrodroidTestApp as a support file. This is needed to avoid having
duplicated install rules for the app file. Without that, we hit
build/make/core/main.mk:1430: error: overriding commands for target
`out/host/linux-x86/cts/android-cts/testcases/MicrodroidTestApp.apk',
previously defined at build/make/core/main.mk:1430
Bug: 204979196
Test: check android-cts-tests_list.zip in the test_suites_[arm64|x86_64]
targets to see if the added tests are here.
Change-Id: Idcea518db04407da993d866b114f17f90be20209
diff --git a/tests/Android.bp b/tests/Android.bp
index cf720f1..58cc06f 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -22,8 +22,13 @@
kernel_modules_stem = "virt_device_prebuilts_kernel_modules-" + kernel_version
cc_test {
- name: "VirtualizationTestCases",
- test_suites: ["general-tests"],
+ // ".64" suffix is to work around cts-unit-test which is demanding that all
+ // executables in CTS should have both 32 and 64 ABIs.
+ name: "VirtualizationTestCases.64",
+ test_suites: [
+ "cts",
+ "general-tests",
+ ],
srcs: [
"common.cc",
"vsock_test.cc",
diff --git a/tests/AndroidTest.xml b/tests/AndroidTest.xml
index 5e7faf9..68e9c1b 100644
--- a/tests/AndroidTest.xml
+++ b/tests/AndroidTest.xml
@@ -15,11 +15,16 @@
-->
<configuration description="Config for Virtualization tests">
+ <option name="test-suite-tag" value="cts" />
+ <option name="config-descriptor:metadata" key="component" value="security" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
+ <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
<!-- Push test binaries to the device. -->
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
<option name="abort-on-push-failure" value="true" />
- <option name="push-file" key="VirtualizationTestCases" value="/data/local/tmp/virt-test/VirtualizationTestCases" />
+ <option name="push-file" key="VirtualizationTestCases.64" value="/data/local/tmp/virt-test/VirtualizationTestCases.64" />
<option name="push-file" key="virt_test_kernel" value="/data/local/tmp/virt-test/kernel" />
<option name="push-file" key="virt_test_initramfs.img" value="/data/local/tmp/virt-test/initramfs" />
</target_preparer>
@@ -30,7 +35,7 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp/virt-test" />
- <option name="module-name" value="VirtualizationTestCases" />
+ <option name="module-name" value="VirtualizationTestCases.64" />
<!-- test-timeout unit is ms, value = 2 minutes -->
<option name="native-test-timeout" value="120000" />
</test>
diff --git a/tests/hostside/Android.bp b/tests/hostside/Android.bp
index d1318b5..9bab286 100644
--- a/tests/hostside/Android.bp
+++ b/tests/hostside/Android.bp
@@ -5,12 +5,16 @@
java_test_host {
name: "MicrodroidHostTestCases",
srcs: ["java/**/*.java"],
- test_suites: ["general-tests"],
+ test_suites: [
+ "cts",
+ "general-tests",
+ ],
libs: [
"tradefed",
],
static_libs: [
"VirtualizationTestHelper",
],
+ per_testcase_directory: true,
data: [":MicrodroidTestApp.signed"],
}
diff --git a/tests/hostside/AndroidTest.xml b/tests/hostside/AndroidTest.xml
index e8aced6..79428ce 100644
--- a/tests/hostside/AndroidTest.xml
+++ b/tests/hostside/AndroidTest.xml
@@ -14,6 +14,11 @@
limitations under the License.
-->
<configuration description="Tests for microdroid">
+ <option name="test-suite-tag" value="cts" />
+ <option name="config-descriptor:metadata" key="component" value="security" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
+ <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
<test class="com.android.compatibility.common.tradefed.testtype.JarHostTest" >
<option name="jar" value="MicrodroidHostTestCases.jar" />
</test>
diff --git a/tests/testapk/Android.bp b/tests/testapk/Android.bp
index 7dca024..5c5e608 100644
--- a/tests/testapk/Android.bp
+++ b/tests/testapk/Android.bp
@@ -4,7 +4,10 @@
android_test {
name: "MicrodroidTestApp",
- test_suites: ["general-tests"],
+ test_suites: [
+ "cts",
+ "general-tests",
+ ],
srcs: ["src/java/**/*.java"],
static_libs: [
"androidx.test.runner",
@@ -16,6 +19,8 @@
jni_libs: ["MicrodroidTestNativeLib"],
platform_apis: true,
use_embedded_native_libs: true,
+ // We only support 64-bit ABI, but CTS demands all APKs to be multi-ABI.
+ compile_multilib: "both",
}
// TODO(jiyong): make this a binary, not a shared library
diff --git a/tests/testapk/AndroidTest.xml b/tests/testapk/AndroidTest.xml
index c7097db..e8bb1aa 100644
--- a/tests/testapk/AndroidTest.xml
+++ b/tests/testapk/AndroidTest.xml
@@ -14,7 +14,12 @@
limitations under the License.
-->
<configuration description="Runs sample instrumentation test.">
- <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
+ <option name="test-suite-tag" value="cts" />
+ <option name="config-descriptor:metadata" key="component" value="security" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
+ <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
+ <option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
+ <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="test-file-name" value="MicrodroidTestApp.apk" />
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">