CI: switch arm64 XTF test runner to qemu-xtf.sh

Hook arm64 QEMU configuration to qemu-xtf.sh and use new script in arm64 CI
jobs.

Signed-off-by: Denis Mukhin <dmukhin@ford.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Denis Mukhin authored and Stefano Stabellini committed 2025-04-22 13:07:13 -07:00
1 parent 23041e72d9
commit 934fcfb17d
5 files changed
+88 -70

No files matched your search

+2 -2
View File
@@ -571,7 +571,7 @@ qemu-smoke-dom0less-arm64-gcc-debug-earlyprintk:
qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
extends: .qemu-arm64
script:
- ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
- ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
needs:
- alpine-3.18-gcc-arm64
- qemu-system-aarch64-6.0.0-arm64-export
@@ -579,7 +579,7 @@ qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
extends: .qemu-arm64
script:
- ./automation/scripts/qemu-xtf-dom0less-arm64.sh hyp-xen-version 2>&1 | tee ${LOGFILE}
- ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
needs:
- alpine-3.18-gcc-debug-arm64
- qemu-system-aarch64-6.0.0-arm64-export
+3
View File
@@ -1,3 +1,6 @@
/binaries/
/imagebuilder/
/smoke.serial
/xtf-*/
*.rom
@@ -0,0 +1,2 @@
CONFIG_GICV2=y
CONFIG_SBSA_UART=y
+81
View File
@@ -0,0 +1,81 @@
#!/bin/bash
#
# XTF test utilities (arm64).
#
# Arch-specific environment overrides.
function xtf_arch_prepare()
{
export FW_PREFIX="${FW_PREFIX:-/usr/lib/u-boot/qemu_arm64/}"
export QEMU_PREFIX="${QEMU_PREFIX:-${WORKDIR}/}"
export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=dtuart}"
export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-xtf-arm}"
export XTF_SRC_URI="${XTF_SRC_URI:-https://gitlab.com/xen-project/fusa/xtf.git}"
export XTF_SRC_VARIANTS="mmu64le"
}
# Perform arch-specific XTF environment setup.
function xtf_arch_setup()
{
# QEMU looks for "efi-virtio.rom" even if it is unneeded
curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
# Crude check for local testing
if [ ! -d imagebuilder ]; then
git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
fi
cat > ${WORKDIR}/config <<EOF
MEMORY_START="0x40000000"
MEMORY_END="0xC0000000"
XEN="xen"
DEVICE_TREE="virt-gicv2.dtb"
XEN_CMD="${XEN_CMDLINE}"
DOMU_KERNEL[0]="xtf-test"
DOMU_MEM[0]="128"
NUM_DOMUS=1
LOAD_CMD="tftpb"
UBOOT_SOURCE="boot.source"
UBOOT_SCRIPT="boot.scr"
EOF
cp ${XTF_BINARY} ${WORKDIR}/xtf-test
# Generate virt-gicv2.dtb
${WORKDIR}/qemu-system-aarch64 \
-machine virtualization=true \
-cpu cortex-a57 \
-machine type=virt \
-m 2048 \
-smp 2 \
-display none \
-machine dumpdtb=${WORKDIR}/virt-gicv2.dtb
# Generate U-Boot environment
bash -x imagebuilder/scripts/uboot-script-gen \
-t tftp \
-d ${WORKDIR}/ \
-c ${WORKDIR}/config
export TEST_CMD="${QEMU_PREFIX}qemu-system-aarch64 \
-machine virtualization=true \
-cpu cortex-a57 \
-machine type=virt \
-no-reboot \
-nographic \
-monitor none \
-serial stdio \
-m 2048 \
-smp 2 \
-device virtio-net-pci,netdev=n0 \
-netdev user,id=n0,tftp=${WORKDIR} \
-bios ${FW_PREFIX}u-boot.bin \
"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
}
@@ -1,68 +0,0 @@
#!/bin/bash
set -ex -o pipefail
# Name of the XTF test
xtf_test=$1
# Message returned by XTF in case of success
passed="Test result: SUCCESS"
# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
./binaries/qemu-system-aarch64 \
-machine virtualization=true \
-cpu cortex-a57 -machine type=virt \
-m 2048 -smp 2 -display none \
-machine dumpdtb=binaries/virt-gicv2.dtb
# XTF
# Build a single XTF test passed as a first parameter to the script.
# Build XTF with GICv2 support to match Qemu configuration and with SBSA UART
# support, so that the test will use an emulated UART for printing messages.
# This will allow us to run the test on both debug and non-debug Xen builds.
rm -rf xtf
git clone https://gitlab.com/xen-project/fusa/xtf.git -b xtf-arm
make -C xtf TESTS=tests/${xtf_test} CONFIG_SBSA_UART=y CONFIG_GICV2=y -j$(nproc)
cp xtf/tests/${xtf_test}/test-mmu64le-${xtf_test} binaries/xtf-test
# ImageBuilder
echo 'MEMORY_START="0x40000000"
MEMORY_END="0xC0000000"
XEN="xen"
DEVICE_TREE="virt-gicv2.dtb"
XEN_CMD="console=dtuart console_timestamps=boot"
DOMU_KERNEL[0]="xtf-test"
DOMU_MEM[0]="128"
NUM_DOMUS=1
LOAD_CMD="tftpb"
UBOOT_SOURCE="boot.source"
UBOOT_SCRIPT="boot.scr"' > binaries/config
rm -rf imagebuilder
git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/config
# Run the test
rm -f smoke.serial
export TEST_CMD="./binaries/qemu-system-aarch64 \
-machine virtualization=true \
-cpu cortex-a57 -machine type=virt \
-m 2048 -monitor none -serial stdio \
-smp 2 \
-no-reboot \
-device virtio-net-pci,netdev=n0 \
-netdev user,id=n0,tftp=binaries \
-bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
export BOOT_MSG="Latest ChangeSet: "
export TEST_LOG="smoke.serial"
export PASSED="${passed}"
./automation/scripts/console.exp | sed 's/\r\+$//'
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.