ci-automation/vendor-testing: add qemu_uefi

This change adds the qemu_uefi.sh vendor test. It reuses most of the
implementation in qemu.sh (qemu_uefi.sh is a soft-link to qemu.sh).

This also enables qemu testing for ARM64.

Signed-off-by: Thilo Fromm <thilo@kinvolk.io>
This commit is contained in:
Thilo Fromm 2022-02-24 13:54:58 +01:00
parent 368aa61796
commit 9afab3aac4
3 changed files with 41 additions and 3 deletions

View File

@ -27,6 +27,19 @@ CI_GIT_EMAIL="infra+ci@flatcar-linux.org"
CONTAINER_TORCX_ROOT="/home/sdk/build/torcx"
CONTAINER_IMAGE_ROOT="/home/sdk/build/images"
#
# Image / vendor tests settings
#
# -- QEMU --
QEMU_IMAGE_NAME="flatcar_production_image.bin"
QEMU_PARALLEL="${PARALLEL_TESTS:-20}"
# BIOS path within the SDK
QEMU_BIOS="/usr/share/qemu/bios-256k.bin"
# UEFI bios filename on build cache.
# Published by vms.sh as part of the qemu vendor build.
QEMU_UEFI_BIOS="flatcar_production_qemu_uefi_efi_code.fd"

View File

@ -20,20 +20,44 @@ source ci-automation/ci_automation_common.sh
mkdir -p "${work_dir}"
cd "${work_dir}"
testscript="$(basename "$0")"
# ARM64 qemu tests only supported on UEFI
if [ "${arch}" = "arm64" ] && [ "${testscript}" != "qemu_uefi.sh" ] ; then
echo "1..1" > "${tapfile}"
echo "not ok - all qemu tests" >> "${tapfile}"
echo " ---" >> "${tapfile}"
echo " ERROR: ARM64 tests only supported on qemu_uefi." | tee -a "${tapfile}"
echo " ..." >> "${tapfile}"
exit 1
fi
# Fetch image and BIOS if not present
if [ -f "${QEMU_IMAGE_NAME}" ] ; then
echo "++++ QEMU test: Using existing ${work_dir}/${QEMU_IMAGE_NAME} for testing ${vernum} (${arch}) ++++"
echo "++++ ${testscript}: Using existing ${work_dir}/${QEMU_IMAGE_NAME} for testing ${vernum} (${arch}) ++++"
else
echo "++++ QEMU test: downloading ${QEMU_IMAGE_NAME} for ${vernum} (${arch}) ++++"
echo "++++ ${testscript}: downloading ${QEMU_IMAGE_NAME} for ${vernum} (${arch}) ++++"
copy_from_buildcache "images/${arch}/${vernum}/${QEMU_IMAGE_NAME}" .
fi
bios="${QEMU_BIOS}"
if [ "${testscript}" = "qemu_uefi.sh" ] ; then
bios="${QEMU_UEFI_BIOS}"
if [ -f "${bios}" ] ; then
echo "++++ ${testscript}: Using existing ${work_dir}/${bios} ++++"
else
echo "++++ ${testscript}: downloading ${bios} for ${vernum} (${arch}) ++++"
copy_from_buildcache "images/${arch}/${vernum}/${bios}" .
fi
fi
set -o noglob
sudo kola run \
--board="${arch}-usr" \
--parallel="${QEMU_PARALLEL}" \
--platform=qemu \
--qemu-bios=/usr/share/qemu/bios-256k.bin \
--qemu-bios=${bios} \
--qemu-image="${QEMU_IMAGE_NAME}" \
--tapfile="${tapfile}" \
--torcx-manifest=../torcx_manifest.json \

View File

@ -0,0 +1 @@
qemu.sh