mirror of
https://github.com/ARM-software/devlib.git
synced 2025-09-13 07:21:54 +01:00
tools/docker: Add Docker image support for devlib
Introduce a Dockerfile in order to create Docker image for devlib and ``run_tests.sh`` script to test Android, Linux, LocalLinux, and QEMU targets on the Docker image. The Dockerfile forks from ``Ubuntu-22.04``, installs required system packages, checks out ``master`` branch of devlib, installs devlib, creates Android virtual devices via ``tools/android/install_base.sh``, and QEMU images for aarch64 and x86_84 architectures. Note that Android command line tools version, buildroot and devlib branches can be customized via environment variables. Signed-off-by: Metin Kaya <metin.kaya@arm.com>
This commit is contained in:
41
tools/docker/run_tests.sh
Executable file
41
tools/docker/run_tests.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Copyright (C) 2024, ARM Limited and contributors.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Prepare the groundwork and run tests/test_target.py on the Docker image.
|
||||
#
|
||||
|
||||
set -eu
|
||||
|
||||
ANDROID_HOME="/devlib/tools/android/android-sdk-linux"
|
||||
export ANDROID_HOME
|
||||
export ANDROID_USER_HOME="${ANDROID_HOME}/.android"
|
||||
export ANDROID_EMULATOR_HOME="${ANDROID_HOME}/.android"
|
||||
export PATH=${ANDROID_HOME}/platform-tools/:${PATH}
|
||||
|
||||
EMULATOR="${ANDROID_HOME}/emulator/emulator"
|
||||
EMULATOR_ARGS="-no-window -no-snapshot -memory 2048"
|
||||
${EMULATOR} -avd devlib-p6-12 ${EMULATOR_ARGS} &
|
||||
${EMULATOR} -avd devlib-p6-14 ${EMULATOR_ARGS} &
|
||||
${EMULATOR} -avd devlib-chromeos ${EMULATOR_ARGS} &
|
||||
|
||||
echo "Waiting 30 seconds for Android virtual devices to finish boot up..."
|
||||
sleep 30
|
||||
|
||||
cd /devlib
|
||||
cp -f tools/docker/target_configs.yaml tests/
|
||||
python3 -m pytest --log-cli-level DEBUG ./tests/test_target.py
|
Reference in New Issue
Block a user