Skip to content

Commit ea5496e

Browse files
committed
android: noninteractive-tradefed: readd install_deps
Readd install_deps so the test can install the correct dependencies without having to find them. Add a python version check that errors out if the python version isn't >=3.8. Fixes: 2caa92b ("noninteractive-tradefed: change to work with python3") Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
1 parent 7588465 commit ea5496e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

automated/android/noninteractive-tradefed/setup.sh

+9
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@
55
. ../../lib/sh-test-lib
66
. ../../lib/android-test-lib
77

8+
SKIP_INSTALL=${1:-"false"}
9+
JDK="openjdk-11-jdk-headless"
810
java_path="/usr/lib/jvm/java-11-openjdk-amd64/bin/java"
911
if [ -n "${ANDROID_VERSION}" ] && echo "${ANDROID_VERSION}" | grep -q "aosp-android14"; then
1012
# use openjdk-17 for Android14+ versions
13+
JDK="openjdk-17-jdk-headless"
1114
java_path="/usr/lib/jvm/java-17-openjdk-amd64/bin/java"
1215
fi
1316

17+
PKG_DEPS="coreutils usbutils curl wget zip xz-utils python-lxml python-setuptools python-pexpect aapt lib32z1-dev libc6-dev-i386 lib32gcc1 libc6:i386 libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386 python-dev python-protobuf protobuf-compiler python-virtualenv python-pip python-pexpect psmisc"
18+
1419
dist_name
1520
case "${dist}" in
1621
ubuntu)
22+
dpkg --add-architecture i386
23+
apt-get update -q
24+
install_deps "${PKG_DEPS} ${JDK}" "${SKIP_INSTALL}"
1725
# make sure to use the right java version
1826
update-alternatives --set java ${java_path}
1927
;;
@@ -22,6 +30,7 @@ case "${dist}" in
2230
;;
2331
esac
2432

33+
chech_python_version "$(python --verison)" "3.8" "Error"
2534
install_latest_adb
2635
initialize_adb
2736
adb_root

automated/android/noninteractive-tradefed/tradefed.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ metadata:
1414
- functional
1515

1616
params:
17+
SKIP_INSTALL: "false"
1718
# Specify timeout in seconds for wait_boot_completed and wait_homescreen.
1819
TIMEOUT: "300"
1920
# Download CTS package or copy it from local disk.
@@ -46,7 +47,7 @@ run:
4647
steps:
4748
- cd ./automated/android/noninteractive-tradefed
4849
# Run setup.sh in the original shell to reserve env variables.
49-
- . ./setup.sh
50+
- . ./setup.sh "${SKIP_INSTALL}"
5051
- echo "after ./setup.sh"
5152
# delete the test user to clean environment
5253
- userdel testuser -r -f || true

0 commit comments

Comments
 (0)