flatcar-scripts/jenkins/kola/qemu_uefi_arm64.sh
Jeremi Piotrowski c8dd87c095 jenkins: add script to run kola arm64 tests under docker
Included is a dockerfile that installs system deps of kola in an debian:11
image. For the test script, the control flow is:

qemu_uefi.sh
  qemu_uefi_arm64.sh
    (docker)
      qemu_common.sh

qemu_common uses the 'NATIVE_ARM64' variable passed by the jenkins job to control the behavior.
The differences are:

* use git directly to fetch (and verify) the manifest
* setup some symlinks so that /var/tmp is on the same BTRFS partition as $PWD/tmp
* setup symlinks so that we don't have to fixup installation of mantle to chroot
* run things directly instead of in chroot through cork

The whole script is executed as root, because kola requires root privileges
anyway and making kvm and sudo work with an arbitrary host user inside the
container would require a custom entrypoint to setup groups.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2021-09-06 14:08:11 +02:00

41 lines
889 B
Bash
Executable File

#!/bin/bash
set -ex
SCRIPTFOLDER="$(dirname "$(readlink -f "$0")")"
# strip $PWD prefix so that we can access the path relative to the container working directory
SCRIPTFOLDER=${SCRIPTFOLDER#$PWD/}
DOCKER_IMG=ghcr.io/kinvolk/kola-test-runner:latest
envarg=()
envflags=(
SSH_AUTH_SOCK
BOARD
MANIFEST_URL
SDK_URL_PATH
CHANNEL_BASE
GROUP
KOLA_TESTS
MANIFEST_TAG
DOWNLOAD_ROOT
PARALLEL
GOOGLE_APPLICATION_CREDENTIALS
NATIVE_ARM64
)
for envvar in ${envflags[@]}; do
envarg+=( -e "${envvar}=${!envvar}" )
done
docker pull ${DOCKER_IMG}
exec docker run --privileged \
--rm \
-v /dev:/dev \
-w /mnt/host/source \
-v ${PWD}:/mnt/host/source \
-v ${GOOGLE_APPLICATION_CREDENTIALS}:${GOOGLE_APPLICATION_CREDENTIALS} \
${SSH_AUTH_SOCK:+-v ${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}} \
"${envarg[@]}" \
${DOCKER_IMG} \
"${SCRIPTFOLDER}/qemu_common.sh" qemu_uefi