Skip to content

Commit

Permalink
android: noninteractive-tradefed: readd install_deps
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
roxell committed Aug 11, 2023
1 parent 7588465 commit ea5496e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions automated/android/noninteractive-tradefed/setup.sh
Expand Up @@ -5,15 +5,23 @@
. ../../lib/sh-test-lib
. ../../lib/android-test-lib

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

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"

dist_name
case "${dist}" in
ubuntu)
dpkg --add-architecture i386
apt-get update -q
install_deps "${PKG_DEPS} ${JDK}" "${SKIP_INSTALL}"
# make sure to use the right java version
update-alternatives --set java ${java_path}
;;
Expand All @@ -22,6 +30,7 @@ case "${dist}" in
;;
esac

chech_python_version "$(python --verison)" "3.8" "Error"
install_latest_adb
initialize_adb
adb_root
Expand Down
3 changes: 2 additions & 1 deletion automated/android/noninteractive-tradefed/tradefed.yaml
Expand Up @@ -14,6 +14,7 @@ metadata:
- functional

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

0 comments on commit ea5496e

Please sign in to comment.