@@ -75,30 +75,30 @@ DPKG_ARCHITECTURE=$(dpkg --print-architecture)
7575if [ " ${DPKG_ARCHITECTURE} " = " amd64" ]; then
7676 qemu_command=( qemu-system-x86_64 )
7777 qemu_command+=( -machine q35 )
78+ qemu_command+=( -cpu max )
7879elif [ " ${DPKG_ARCHITECTURE} " = " arm64" ]; then
80+ # Pick a real CPU model, and also one that does not crash QEMU on ubuntu-24.04-arm.
81+ qemu_command=( qemu-system-aarch64 )
82+ qemu_command+=( -machine " type=virt,gic-version=max,accel=kvm:tcg" )
83+ qemu_command+=( -cpu cortex-a76 )
7984 if [ " $TARGET " = ' RPI' ]; then
8085 if ! rpi_bootdata=" $( sudo " $TEST_PWD " /tests/extract-rpi-bootdata.sh " $VM_IMAGE " ) " ; then
8186 echo " E: could not extract RPi boot data" >&2
8287 exit 1
8388 fi
8489 IFS=' |' read rpi_kern rpi_initrd rpi_kerncmd <<< " $rpi_bootdata"
85- qemu_command=( qemu-system-aarch64 )
86- qemu_command+=( -machine " type=virt,gic-version=max,accel=kvm:tcg,highmem=off" )
8790 qemu_command+=( -kernel " $rpi_kern " )
8891 qemu_command+=( -initrd " $rpi_initrd " )
8992 qemu_command+=( -append " $rpi_kerncmd " )
9093 else
9194 cp /usr/share/AAVMF/AAVMF_VARS.fd efi_vars.fd
92- qemu_command=( qemu-system-aarch64 )
93- qemu_command+=( -machine " type=virt,gic-version=max,accel=kvm:tcg" )
9495 qemu_command+=( -drive " if=pflash,format=raw,unit=0,file.filename=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd,file.locking=off,readonly=on" )
9596 qemu_command+=( -drive " if=pflash,format=raw,unit=1,file=efi_vars.fd" )
9697 fi
9798else
9899 echo " E: unsupported ${DPKG_ARCHITECTURE} " >&2
99100 exit 1
100101fi
101- qemu_command+=( -cpu max )
102102qemu_command+=( -smp 2 )
103103qemu_command+=( -m 2048 )
104104qemu_command+=( -drive " file=${VM_IMAGE} ,format=raw,index=0,media=disk" )
@@ -124,6 +124,13 @@ if [ ! -d results ] || [ ! -f ./results/goss.tap ] || [ ! -f ./results/goss.exit
124124 echo " Running tests inside VM failed for unknown reason" >&2
125125 RC=1
126126 cat results/goss.err || true
127+ if ! kill -0 " ${QEMU_PID} " 2> /dev/null; then
128+ echo " E: qemu (pid ${QEMU_PID} ) has exited" >&2
129+ fi
130+ if [ -r qemu.log ]; then
131+ echo " qemu.log follows:" >&2
132+ cat qemu.log >&2
133+ fi
127134else
128135 RC=$( cat results/goss.exitcode)
129136 echo " goss exitcode: $RC "
0 commit comments