[automerger skipped] Merge changes from topic "cherrypicker-L67900030002138301:N95200030034784381" into android14-tests-dev am: d2a0e6d91a -s ours
am skip reason: Merged-In I609cebf6b0484f6d03dae04bf6f6ec586ab60a2e with SHA-1 58bcb3c4bc is already in history
Original change: https://android-review.googlesource.com/c/platform/test/vts/+/2975913
Change-Id: I7f4ded173c1569500d43eff1dacbebcb875da127
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/OWNERS b/OWNERS
index 117c4b8..ecc9b44 100644
--- a/OWNERS
+++ b/OWNERS
@@ -2,3 +2,7 @@
guangzhu@google.com
jdesprez@google.com
sbasi@google.com
+
+# Android xTS Infra Approvers
+wenshan@google.com
+kgui@google.com
diff --git a/tests/fastboot_getvar/OWNERS b/tests/fastboot_getvar/OWNERS
index fd9883a..e5953d6 100644
--- a/tests/fastboot_getvar/OWNERS
+++ b/tests/fastboot_getvar/OWNERS
@@ -1,4 +1,4 @@
-# Bug component: 30545
+# Bug component: 1228891
dvander@google.com
bowgotsai@google.com
elsk@google.com
diff --git a/tests/fastboot_getvar/src/com/android/tests/FastbootGetvarUserspaceTest.java b/tests/fastboot_getvar/src/com/android/tests/FastbootGetvarUserspaceTest.java
index 16d87a3..80d1220 100644
--- a/tests/fastboot_getvar/src/com/android/tests/FastbootGetvarUserspaceTest.java
+++ b/tests/fastboot_getvar/src/com/android/tests/FastbootGetvarUserspaceTest.java
@@ -132,27 +132,6 @@
assertNotNull(osVersion);
}
- /* Devices launching in R and after must export version-vndk. */
- @Test
- public void testVndkVersion() throws Exception {
- String vndkVersion = getTestInformation().getDevice().getFastbootVariable("version-vndk");
- String codeName = sDeviceCodeName.get(getTestInformation().getDevice());
- CLog.d("vndk version: '%s', code name: '%s'", vndkVersion, codeName);
- // The value of vndkVersion might be a letter or a string on pre-release builds,
- // e.g., R or Tiramisu.
- // And it is a number representing the API level on final release builds, e.g., 30.
- if ("REL".equals(codeName)) {
- try {
- int intVndkVersion = Integer.parseInt(vndkVersion);
- assertTrue(intVndkVersion >= PLATFORM_API_LEVEL_R);
- } catch (NumberFormatException nfe) {
- fail("ro.vndk.version should be a number. But the current value is " + vndkVersion);
- }
- } else {
- assertNotNull(vndkVersion);
- }
- }
-
/* Devices launching in R and after must export dynamic-partition. */
@Test
public void testDynamicPartition() throws Exception {
diff --git a/tests/fastboot_test/OWNERS b/tests/fastboot_test/OWNERS
index 6900bb8..b0c8423 100644
--- a/tests/fastboot_test/OWNERS
+++ b/tests/fastboot_test/OWNERS
@@ -1,3 +1,3 @@
-# Bug component: 30545
+# Bug component: 1228891
dvander@google.com
elsk@google.com
diff --git a/tests/firmware_dtbo_test/OWNERS b/tests/firmware_dtbo_test/OWNERS
index 245e64e..3cd73e4 100644
--- a/tests/firmware_dtbo_test/OWNERS
+++ b/tests/firmware_dtbo_test/OWNERS
@@ -1,2 +1,2 @@
-# Bug component: 30545
+# Bug component: 391836
vmartensson@google.com
diff --git a/tests/firmware_test/OWNERS b/tests/firmware_test/OWNERS
index 2f0c279..87bd4d1 100644
--- a/tests/firmware_test/OWNERS
+++ b/tests/firmware_test/OWNERS
@@ -1,2 +1,2 @@
-# Bug component: 30545
+# Bug component: 391836
yochiang@google.com
diff --git a/tests/gpu_test/Android.bp b/tests/gpu_test/Android.bp
index 47b67be..0dbe050 100644
--- a/tests/gpu_test/Android.bp
+++ b/tests/gpu_test/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_gpu",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/tests/gpu_test/src/com/android/gpu/vts/Build.java b/tests/gpu_test/src/com/android/gpu/vts/Build.java
index 8b6ad52..7ce8703 100644
--- a/tests/gpu_test/src/com/android/gpu/vts/Build.java
+++ b/tests/gpu_test/src/com/android/gpu/vts/Build.java
@@ -51,4 +51,5 @@
public static final int SC_V2 = 32; // provisional
public static final int TM = 33; // provisional
public static final int UDC = 34; // provisional
+ public static final int VIC = 35; // provisional
}
diff --git a/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java b/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java
index c88edd7..e7c2fac 100644
--- a/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java
+++ b/tests/gpu_test/src/com/android/gpu/vts/VulkanTest.java
@@ -43,6 +43,9 @@
private static final int VULKAN_1_1_API_VERSION = 0x401000;
private static final int VULKAN_1_3_API_VERSION = 0x403000;
+ // Feature version corresponding to dEQP level for 2024-03-01.
+ public static final int DEQP_LEVEL_FOR_V = 0x7E80301;
+
// Feature version corresponding to dEQP level for 2023-03-01.
public static final int DEQP_LEVEL_FOR_U = 0x7E70301;
@@ -202,8 +205,11 @@
case Build.UDC:
requiredVulkanDeqpLevel = DEQP_LEVEL_FOR_U;
break;
+ case Build.VIC:
+ requiredVulkanDeqpLevel = DEQP_LEVEL_FOR_V;
+ break;
default:
- fail("Test should only run for API levels: R, S, Sv2, TM, UDC, ...");
+ fail("Test should only run for API levels: R, S, Sv2, TM, UDC, VIC...");
return;
}
diff --git a/tests/kernel_proc_file_api_test/Android.bp b/tests/kernel_proc_file_api_test/Android.bp
index ac10837..8a37d5b 100644
--- a/tests/kernel_proc_file_api_test/Android.bp
+++ b/tests/kernel_proc_file_api_test/Android.bp
@@ -51,6 +51,7 @@
"vts_vndk_utils",
],
test_suites: [
+ "general-tests",
"vts",
],
test_config: "kernel_proc_file_api_test.xml",
diff --git a/tests/kernel_proc_file_api_test/OWNERS b/tests/kernel_proc_file_api_test/OWNERS
index 245e64e..3cd73e4 100644
--- a/tests/kernel_proc_file_api_test/OWNERS
+++ b/tests/kernel_proc_file_api_test/OWNERS
@@ -1,2 +1,2 @@
-# Bug component: 30545
+# Bug component: 391836
vmartensson@google.com
diff --git a/tests/selinux_test/OWNERS b/tests/selinux_test/OWNERS
index 245e64e..75e3a1b 100644
--- a/tests/selinux_test/OWNERS
+++ b/tests/selinux_test/OWNERS
@@ -1,2 +1,2 @@
-# Bug component: 30545
+# Bug component: 85141
vmartensson@google.com
diff --git a/tools/vts-core-tradefed/Android.bp b/tools/vts-core-tradefed/Android.bp
index f88071f..e766014 100644
--- a/tools/vts-core-tradefed/Android.bp
+++ b/tools/vts-core-tradefed/Android.bp
@@ -35,10 +35,10 @@
wrapper: "etc/vts-tradefed",
short_name: "VTS",
full_name: "Vendor Test Suite",
- version: "14_r5",
+ version: "14_r1",
static_libs: [
- "cts-tradefed-harness",
"vts-core-tradefed-harness",
+ "cts-tradefed-harness",
],
required: ["compatibility-host-util"],
}
diff --git a/tools/vts-core-tradefed/etc/vts-tradefed b/tools/vts-core-tradefed/etc/vts-tradefed
index 8e07c6d..9bb9e84 100755
--- a/tools/vts-core-tradefed/etc/vts-tradefed
+++ b/tools/vts-core-tradefed/etc/vts-tradefed
@@ -17,49 +17,36 @@
# launcher script for vts-tradefed harness
# can be used from an Android build environment, or a standalone vts zip
-checkFile() {
- if [ ! -f "$1" ]; then
- echo "Unable to locate $1"
- exit
- fi;
-}
+UTILS_SCRIPT="$(dirname $(realpath $0))/test-utils-script"
-checkPath() {
- if ! type -P $1 &> /dev/null; then
- echo "Unable to find $1 in path."
- exit
- fi;
-}
+if [ ! -f "${UTILS_SCRIPT}" ]
+then
+ UTILS_SCRIPT="${ANDROID_BUILD_TOP}/platform_testing/scripts/test-utils-script"
+fi
-# readlink does not work on MacOS so rely on our own realpath
-realpath() {
- [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
-}
+if [ ! -f "${UTILS_SCRIPT}" ]
+then
+ echo -e "Cannot find test-utils-script in the same location as this script and ANDROID_BUILD_TOP is not defined."
+ exit 1
+fi
+
+source ${UTILS_SCRIPT}
checkPath aapt
checkPath adb
-checkPath java
-# check java version
-JAVA_VERSION=$(java -version 2>&1 | grep 'version [ "]\(1\.8\|9\|11\|17\).*[ "]' | head -n 1)
-if [ "${JAVA_VERSION}" == "" ]; then
- echo "Wrong java version. 1.8, 9, 11 or 17 is required."
- exit
-fi
-
-# check debug flag and set up remote debugging
-if [ -n "${TF_DEBUG}" ]; then
- if [ -z "${TF_DEBUG_PORT}" ]; then
- TF_DEBUG_PORT=10088
- fi
- RDBG_FLAG=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=${TF_DEBUG_PORT}
-fi
+RDBG_FLAG=$(getRemoteDbgFlag)
# get OS
HOST=`uname`
-if [ "$HOST" == "Linux" ]; then
+HOST_ARCH=`uname -sm`
+if [ "$HOST_ARCH" == "Linux x86_64" ]; then
OS="linux-x86"
-elif [ "$HOST" == "Darwin" ]; then
+elif [ "$HOST_ARCH" == "Linux aarch64" ]; then
+ OS="linux-arm64"
+ # Bundled java is for linux-x86 so use host JDK on linux-arm64
+ JAVA_BINARY=java
+elif [ "$HOST_ARCH" == "Darwin x86_64" ]; then
OS="darwin-x86"
# Bundled java is for linux so use host JDK on Darwin
JAVA_BINARY=java
@@ -94,6 +81,9 @@
JAVA_BINARY=java
fi
+checkPath ${JAVA_BINARY}
+checkJavaVersion ${JAVA_BINARY}
+
JAR_DIR=${VTS_ROOT}/android-vts/tools
for JAR in ${JAR_DIR}/*.jar; do
@@ -115,15 +105,8 @@
fi;
done
-# load any shared libraries for host-side executables
LIB_DIR=${VTS_ROOT}/android-vts/lib
-if [ "$HOST" == "Linux" ]; then
- LD_LIBRARY_PATH=${LIB_DIR}:${LIB_DIR}64:${LD_LIBRARY_PATH}
- export LD_LIBRARY_PATH
-elif [ "$HOST" == "Darwin" ]; then
- DYLD_LIBRARY_PATH=${LIB_DIR}:${LIB_DIR}64:${DYLD_LIBRARY_PATH}
- export DYLD_LIBRARY_PATH
-fi
+loadSharedLibraries "$HOST" "$LIB_DIR"
# include any host-side test jars
for j in $(find ${VTS_ROOT}/android-vts/testcases -type f -name '*.jar'); do
diff --git a/tools/vts-core-tradefed/res/config/collect-tests-only.xml b/tools/vts-core-tradefed/res/config/collect-tests-only.xml
new file mode 100644
index 0000000..c22265b
--- /dev/null
+++ b/tools/vts-core-tradefed/res/config/collect-tests-only.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Runs VTS from a pre-existing VTS installation">
+
+ <include name="vts" />
+
+ <!-- This tells vts-tradefed and the server what the plan name is, reports that have this plan
+ name should not be accepted, as it doesn't actually run the tests it simply marks all of
+ them as passed.
+ Obviously no one would modify the report before uploading to falsify this
+ information, as that would be dishonest, and dishonesty kills kittens :'( -->
+ <option name="plan" value="collect-tests-only" />
+
+ <option name="skip-preconditions" value="true" />
+ <option name="skip-system-status-check" value="com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker" />
+ <option name="preparer-whitelist" value="com.android.tradefed.targetprep.suite.SuiteApkInstaller" />
+ <option name="preparer-whitelist" value="com.android.compatibility.common.tradefed.targetprep.ApkInstaller" />
+ <option name="preparer-whitelist" value="com.android.compatibility.common.tradefed.targetprep.FilePusher" />
+
+ <option name="compatibility:collect-tests-only" value="true" />
+
+</configuration>
diff --git a/tools/vts-core-tradefed/res/config/vts-exclude.xml b/tools/vts-core-tradefed/res/config/vts-exclude.xml
index e64fbd0..5e1702d 100644
--- a/tools/vts-core-tradefed/res/config/vts-exclude.xml
+++ b/tools/vts-core-tradefed/res/config/vts-exclude.xml
@@ -34,10 +34,4 @@
<option name="compatibility:exclude-filter" value="VtsHalConfirmationUIV1_0TargetTest *ConfirmationUIHidlTest.MalformedUTF8Test2/*"/>
<option name="compatibility:exclude-filter" value="VtsHalConfirmationUIV1_0TargetTest *ConfirmationUIHidlTest.MalformedUTF8Test3/*"/>
- <!-- b/281630896: Disable tests for UDC as not enough soak time to test the proposed fix in ag/23905225. -->
- <option name="compatibility:exclude-filter" value="VtsHalUwbTargetTest *UwbAidl.ChipClose/*"/>
- <option name="compatibility:exclude-filter" value="VtsHalUwbTargetTest *UwbAidl.ChipCoreInit/*"/>
- <option name="compatibility:exclude-filter" value="VtsHalUwbTargetTest *UwbAidl.ChipOpen/*"/>
- <option name="compatibility:exclude-filter" value="VtsHalUwbTargetTest *UwbAidl.ChipSessionInit/*"/>
- <option name="compatibility:exclude-filter" value="VtsHalUwbTargetTest *UwbAidl.ChipGetSupportedAndroidUciVersion/*"/>
</configuration>
diff --git a/tools/vts-core-tradefed/res/config/vts-hal-audio.xml b/tools/vts-core-tradefed/res/config/vts-hal-audio.xml
new file mode 100644
index 0000000..9496c40
--- /dev/null
+++ b/tools/vts-core-tradefed/res/config/vts-hal-audio.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="VTS Audio HAL Test Plan">
+ <include name="vts" />
+ <include name="vts-presubmit-exclude" />
+
+ <option name="plan" value="vts-hal-audio" />
+ <option name="test-tag" value="vts-hal-audio" />
+
+ <!-- AudioCore -->
+ <option name="compatibility:include-filter" value="VtsHalAudioCoreTargetTest" />
+
+ <!-- AudioEffects -->
+ <option name="compatibility:include-filter" value="VtsHalAECTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalAGC1TargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalAGC2TargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalAudioEffectFactoryTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalAudioEffectTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalBassBoostTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalDownmixTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalDynamicsProcessingTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalEnvironmentalReverbTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalEqualizerTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalHapticGeneratorTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalLoudnessEnhancerTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalNSTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalPresetReverbTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalVirtualizerTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalVisualizerTargetTest" />
+ <option name="compatibility:include-filter" value="VtsHalVolumeTargetTest" />
+
+ <!-- SoundDose -->
+ <option name="compatibility:include-filter" value="VtsHalSoundDoseFactoryTargetTest" />
+
+</configuration>
\ No newline at end of file
diff --git a/tools/vts-core-tradefed/res/config/vts-kernel.xml b/tools/vts-core-tradefed/res/config/vts-kernel.xml
index cedf483..fdb0c19 100644
--- a/tools/vts-core-tradefed/res/config/vts-kernel.xml
+++ b/tools/vts-core-tradefed/res/config/vts-kernel.xml
@@ -25,6 +25,7 @@
<option name="compatibility:include-filter" value="bpf_module_test" />
<option name="compatibility:include-filter" value="drop_caches_test" />
<option name="compatibility:include-filter" value="KernelApiSysfsTest" />
+ <option name="compatibility:include-filter" value="KernelAbilistTest" />
<option name="compatibility:include-filter" value="KernelDynamicPartitionsTest " />
<option name="compatibility:include-filter" value="KernelLibcutilsTest" />
<option name="compatibility:include-filter" value="KernelSelinuxFileApiTest" />
diff --git a/tools/vts-core-tradefed/src/com/android/tradefed/testtype/binary/KernelTargetTest.java b/tools/vts-core-tradefed/src/com/android/tradefed/testtype/binary/KernelTargetTest.java
deleted file mode 100644
index 1604972..0000000
--- a/tools/vts-core-tradefed/src/com/android/tradefed/testtype/binary/KernelTargetTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.tradefed.testtype.binary;
-
-import com.android.tradefed.config.Option;
-import com.android.tradefed.config.OptionClass;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.result.ITestInvocationListener;
-import com.android.tradefed.result.TestDescription;
-import com.android.tradefed.testtype.IDeviceTest;
-import com.android.tradefed.util.CommandResult;
-import com.android.tradefed.util.CommandStatus;
-import java.io.IOException;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Test runner for executable running on the target and parsing tesult of kernel test.
- */
-@OptionClass(alias = "kernel-target-test")
-public class KernelTargetTest extends ExecutableTargetTest {
- @Option(name = "ignore-binary-check", description = "Ignore the binary check in findBinary().")
- private boolean mIgnoreBinaryCheck = false;
- @Option(name = "exit-code-skip", description = "Exit code for skipped tests.")
- private Integer mExitCodeSkip = null;
-
- @Override
- public String findBinary(String binary) throws DeviceNotAvailableException {
- if (mIgnoreBinaryCheck)
- return binary;
- return super.findBinary(binary);
- }
-
- /**
- * Check the result of the test command.
- *
- * @param result test result of the command {@link CommandResult}
- * @param listener the {@link ITestInvocationListener}
- * @param description The test in progress.
- */
- protected void checkCommandResult(
- CommandResult result, ITestInvocationListener listener, TestDescription description) {
- if (mExitCodeSkip != null && result.getExitCode().equals(mExitCodeSkip)) {
- listener.testIgnored(description);
- } else {
- super.checkCommandResult(result, listener, description);
- }
- }
-}
diff --git a/tools/vts-core-tradefed/src/com/android/tradefed/testtype/suite/module/KernelTestModuleController.java b/tools/vts-core-tradefed/src/com/android/tradefed/testtype/suite/module/KernelTestModuleController.java
deleted file mode 100644
index abd8ef3..0000000
--- a/tools/vts-core-tradefed/src/com/android/tradefed/testtype/suite/module/KernelTestModuleController.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.tradefed.testtype.suite.module;
-
-import com.android.tradefed.config.Option;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.device.StubDevice;
-import com.android.tradefed.invoker.IInvocationContext;
-import com.android.tradefed.log.LogUtil.CLog;
-import com.android.tradefed.util.AbiUtils;
-
-/** Base class for a module controller to not run tests when it doesn't match the architecture . */
-public class KernelTestModuleController extends BaseModuleController {
- private final String lowMemProp = "ro.config.low_ram";
- private final String productNameProp = "ro.product.name";
-
- @Option(name = "arch",
- description = "The architecture name that should run for this module."
- + "This should be like arm64, arm, riscv64, x86_64, or x86.",
- mandatory = true)
- private String mArch = null;
-
- @Option(name = "is-low-mem",
- description = "If this option set to true, run this module if device prop"
- + "of 'ro.config.low_ram' is true else skip it.")
- private boolean mIsLowMem = false;
-
- @Option(name = "is-hwasan",
- description = "If this option set to true, run this module if device prop "
- + "of 'ro.product.name' ended with _hwasan else skip it.")
- private boolean mIsHwasan = false;
-
- @Override
- public RunStrategy shouldRun(IInvocationContext context) {
- // This should return arm64-v8a or armeabi-v7a
- String moduleAbiName = getModuleAbi().getName();
- // Use AbiUtils to get the actual architecture name.
- // If moduleAbiName is arm64-v8a then the moduleArchName will be arm64
- // If moduleAbiName is armeabi-v7a then the moduleArchName will be arm
- String moduleArchName = AbiUtils.getArchForAbi(moduleAbiName);
-
- if (mIsLowMem) {
- if (!deviceLowMem(context)) {
- CLog.d("Skipping module %s because %s is False.", getModuleName(), lowMemProp);
- return RunStrategy.FULL_MODULE_BYPASS;
- }
- } else {
- if (deviceLowMem(context)) {
- CLog.d("Skipping module %s because the test is not for low memory device.",
- getModuleName());
- return RunStrategy.FULL_MODULE_BYPASS;
- }
- }
-
- if (mIsHwasan) {
- if (!deviceWithHwasan(context)) {
- CLog.d("Skipping module %s because %s is not ended with _hwasan.", getModuleName(),
- productNameProp);
- return RunStrategy.FULL_MODULE_BYPASS;
- }
- } else {
- if (deviceWithHwasan(context)) {
- CLog.d("Skipping module %s because the test is for device of hwasan.",
- getModuleName());
- return RunStrategy.FULL_MODULE_BYPASS;
- }
- }
-
- if (mArch.equals(moduleArchName)) {
- return RunStrategy.RUN;
- }
- CLog.d("Skipping module %s running on abi %s, which doesn't match any required setting "
- + "of %s.",
- getModuleName(), moduleAbiName, mArch);
- return RunStrategy.FULL_MODULE_BYPASS;
- }
-
- private boolean deviceLowMem(IInvocationContext context) {
- for (ITestDevice device : context.getDevices()) {
- if (device.getIDevice() instanceof StubDevice) {
- continue;
- }
- try {
- String lowMemString = device.getProperty(lowMemProp);
- boolean isLowMem = false;
- if (lowMemString != null) {
- isLowMem = Boolean.parseBoolean(lowMemString);
- } else {
- CLog.d("Cannot get the prop of %s.", lowMemProp);
- }
- if (isLowMem) {
- continue;
- }
- return false;
- } catch (DeviceNotAvailableException e) {
- CLog.e("Couldn't check prop of %s on %s", lowMemProp, device.getSerialNumber());
- CLog.e(e);
- throw new RuntimeException(e);
- }
- }
- return true;
- }
-
- private boolean deviceWithHwasan(IInvocationContext context) {
- for (ITestDevice device : context.getDevices()) {
- if (device.getIDevice() instanceof StubDevice) {
- continue;
- }
- try {
- String productName = device.getProperty(productNameProp);
- boolean isHwasan = false;
- if (productName != null) {
- isHwasan = productName.contains("_hwasan");
- } else {
- CLog.d("Cannot get the prop of %s.", productNameProp);
- }
- if (isHwasan) {
- continue;
- }
- return false;
- } catch (DeviceNotAvailableException e) {
- CLog.e("Couldn't check prop of %s on %s", productNameProp,
- device.getSerialNumber());
- CLog.e(e);
- throw new RuntimeException(e);
- }
- }
- return true;
- }
-}
diff --git a/tools/vts-core-tradefed/tests/src/com/android/compatibility/tradefed/VtsUnitTests.java b/tools/vts-core-tradefed/tests/src/com/android/compatibility/tradefed/VtsUnitTests.java
index 63c0d4b..77f71a8 100644
--- a/tools/vts-core-tradefed/tests/src/com/android/compatibility/tradefed/VtsUnitTests.java
+++ b/tools/vts-core-tradefed/tests/src/com/android/compatibility/tradefed/VtsUnitTests.java
@@ -18,7 +18,6 @@
import com.android.compatibility.common.tradefed.loading.CommonConfigLoadingTest;
import com.android.compatibility.tradefed.VtsCoreTradefedTest;
-import com.android.tradefed.testtype.suite.module.KernelTestModuleControllerTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@@ -31,7 +30,6 @@
*/
@RunWith(Suite.class)
@SuiteClasses({
- KernelTestModuleControllerTest.class,
VtsCoreTradefedTest.class,
// Loading test
diff --git a/tools/vts-core-tradefed/tests/src/com/android/testtype/suite/module/KernelTestModuleControllerTest.java b/tools/vts-core-tradefed/tests/src/com/android/testtype/suite/module/KernelTestModuleControllerTest.java
deleted file mode 100644
index af45edb..0000000
--- a/tools/vts-core-tradefed/tests/src/com/android/testtype/suite/module/KernelTestModuleControllerTest.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.tradefed.testtype.suite.module;
-
-import static org.junit.Assert.assertEquals;
-
-import com.android.ddmlib.IDevice;
-import com.android.tradefed.config.ConfigurationDef;
-import com.android.tradefed.config.ConfigurationException;
-import com.android.tradefed.config.OptionSetter;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.device.ITestDevice;
-import com.android.tradefed.invoker.IInvocationContext;
-import com.android.tradefed.invoker.InvocationContext;
-import com.android.tradefed.testtype.suite.ModuleDefinition;
-import com.android.tradefed.testtype.suite.module.IModuleController.RunStrategy;
-import org.easymock.EasyMock;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.JUnit4;
-
-/**
- * Unit tests for {@link KernelTestModuleControllerTest}.
- */
-@RunWith(JUnit4.class)
-public class KernelTestModuleControllerTest {
- private KernelTestModuleController mController;
- private IInvocationContext mContext;
- private ITestDevice mMockDevice;
- private IDevice mMockIDevice;
- private final String mProductNameProp = "ro.product.name";
- private final String mLowMemProp = "ro.config.low_ram";
-
- @Before
- public void setUp() {
- mController = new KernelTestModuleController();
- mMockDevice = EasyMock.createMock(ITestDevice.class);
- mContext = new InvocationContext();
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_NAME, "module1");
- mContext.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice);
- mMockIDevice = EasyMock.createMock(IDevice.class);
- }
-
- @Test
- public void testModuleAbiMatchesArch()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("false");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm64");
- assertEquals(RunStrategy.RUN, mController.shouldRunModule(mContext));
- }
-
- @Test
- public void testModuleAbiMismatchesArch()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("false");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm");
- assertEquals(RunStrategy.FULL_MODULE_BYPASS, mController.shouldRunModule(mContext));
- }
-
- @Test
- public void testDeviceWithLowMemAndIsLowMemFlagTrue()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("true");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm64");
- setter.setOptionValue("is-low-mem", "true");
- assertEquals(RunStrategy.RUN, mController.shouldRunModule(mContext));
- EasyMock.verify(mMockDevice);
- }
-
- @Test
- public void testDeviceWithLowMemButIsLowMemFalse()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("true");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm64");
- setter.setOptionValue("is-low-mem", "false");
- assertEquals(RunStrategy.FULL_MODULE_BYPASS, mController.shouldRunModule(mContext));
- }
-
- @Test
- public void testDeviceNotLowMemButIsLowMemFlagTrue()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("false");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product_hwasan");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm64");
- setter.setOptionValue("is-low-mem", "true");
- assertEquals(RunStrategy.FULL_MODULE_BYPASS, mController.shouldRunModule(mContext));
- }
-
- @Test
- public void testDeviceWithHwasanAndIsHwasanFlagTure()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("false");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product_hwasan");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm64");
- setter.setOptionValue("is-hwasan", "true");
- assertEquals(RunStrategy.RUN, mController.shouldRunModule(mContext));
- EasyMock.verify(mMockDevice);
- }
-
- @Test
- public void testDeviceWithHwasanButIsHwasanFlagFalse()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("false");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product_hwasan");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm64");
- setter.setOptionValue("is-hwasan", "false");
- assertEquals(RunStrategy.FULL_MODULE_BYPASS, mController.shouldRunModule(mContext));
- EasyMock.verify(mMockDevice);
- }
-
- @Test
- public void testDeviceNotHwasanButIsHwasanFlagTrue()
- throws DeviceNotAvailableException, ConfigurationException {
- mContext.addInvocationAttribute(ModuleDefinition.MODULE_ABI, "arm64-v8a");
- EasyMock.expect(mMockDevice.getIDevice()).andReturn(mMockIDevice).times(2);
- EasyMock.expect(mMockDevice.getProperty(mLowMemProp)).andReturn("false");
- EasyMock.expect(mMockDevice.getProperty(mProductNameProp)).andReturn("product");
- EasyMock.replay(mMockDevice);
- OptionSetter setter = new OptionSetter(mController);
- setter.setOptionValue("arch", "arm64");
- setter.setOptionValue("is-hwasan", "true");
- assertEquals(RunStrategy.FULL_MODULE_BYPASS, mController.shouldRunModule(mContext));
- EasyMock.verify(mMockDevice);
- }
-}
diff --git a/vndk_utils/Android.bp b/vndk_utils/Android.bp
index d539a99..5e5da93 100644
--- a/vndk_utils/Android.bp
+++ b/vndk_utils/Android.bp
@@ -16,8 +16,9 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-python_library_host {
+python_library {
name: "vndk_utils",
+ host_supported: true,
pkg_path: "vts/utils/python",
srcs: [
"android/__init__.py",
diff --git a/vndk_utils/vndk/vndk_utils.py b/vndk_utils/vndk/vndk_utils.py
index b50ebbb..7908087 100644
--- a/vndk_utils/vndk/vndk_utils.py
+++ b/vndk_utils/vndk/vndk_utils.py
@@ -44,6 +44,21 @@
return True
+def IsVndkRequired(dut):
+ """Returns whether the device's vendor partition requires VNDK.
+
+ VNDK libraries are moved from system to vendor partition in V version. If
+ a device does not require VNDK, it does not define ro.vndk.version.
+
+ Args:
+ dut: The AndroidDevice under test.
+
+ Returns:
+ A boolean, whether VNDK is required.
+ """
+ return bool(dut.GetVndkVersion())
+
+
def IsVndkInstalledInVendor(dut):
"""Returns whether the device's VNDK should be installed in vendor.
diff --git a/vts_hal_hidl_target/VtsCoreUtil.cpp b/vts_hal_hidl_target/VtsCoreUtil.cpp
index 102aa5e..afde99b 100644
--- a/vts_hal_hidl_target/VtsCoreUtil.cpp
+++ b/vts_hal_hidl_target/VtsCoreUtil.cpp
@@ -33,7 +33,7 @@
if (p) {
char* line = NULL;
size_t len = 0;
- __android_log_print(ANDROID_LOG_FATAL, LOG_TAG,
+ __android_log_print(ANDROID_LOG_INFO, LOG_TAG,
"checkSubstringInCommandOutput check with cmd: %s",
cmd);
while (getline(&line, &len, p) > 0) {
@@ -45,7 +45,7 @@
}
pclose(p);
} else {
- __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, "popen failed: %d", errno);
+ __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "popen failed: %d", errno);
_exit(EXIT_FAILURE);
}
__android_log_print(ANDROID_LOG_INFO, LOG_TAG, "Feature %s: %ssupported",