diff --git a/ci-automation/ci-config.env b/ci-automation/ci-config.env index 3a61831e35..18bf88f4c8 100644 --- a/ci-automation/ci-config.env +++ b/ci-automation/ci-config.env @@ -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" + diff --git a/ci-automation/vendor-testing/qemu.sh b/ci-automation/vendor-testing/qemu.sh index 9f174a127c..fe3788d7c4 100755 --- a/ci-automation/vendor-testing/qemu.sh +++ b/ci-automation/vendor-testing/qemu.sh @@ -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 \ diff --git a/ci-automation/vendor-testing/qemu_uefi.sh b/ci-automation/vendor-testing/qemu_uefi.sh new file mode 120000 index 0000000000..a142d967c8 --- /dev/null +++ b/ci-automation/vendor-testing/qemu_uefi.sh @@ -0,0 +1 @@ +qemu.sh \ No newline at end of file