diff --git a/tests/integration/initramfs.bats b/tests/integration/initramfs.bats index e07caec7e05..91d3a981092 100644 --- a/tests/integration/initramfs.bats +++ b/tests/integration/initramfs.bats @@ -39,8 +39,8 @@ function qemu_native() { # Different distributions put qemu-kvm in different locations and with # different names. Debian and Ubuntu have a "kvm" binary, while AlmaLinux # has /usr/libexec/qemu-kvm. - local qemu_candidates=("kvm" "qemu-kvm" "/usr/libexec/qemu-kvm") - local qemu_binary candidate + local qemu_binary= qemu_candidates=("kvm" "qemu-kvm" "/usr/libexec/qemu-kvm") + local candidate for candidate in "${qemu_candidates[@]}"; do "$candidate" -help &>/dev/null || continue qemu_binary="$candidate" @@ -50,20 +50,23 @@ function qemu_native() { # architecture if qemu-kvm is missing? [ -n "$qemu_binary" ] || skip "could not find qemu-kvm binary" - local machine + local machine= case "$(go env GOARCH)" in 386 | amd64) + # Try to use a slightly newer PC CPU. machine="pc" ;; arm | arm64) + # ARM doesn't provide a "default" machine value (because its use is so + # varied) so we have to specify the machine manually. machine="virt" ;; *) echo "could not figure out -machine argument for qemu -- using default" >&2 ;; esac - local machine_args=() - [ -n "$machine" ] && machine_args=("-machine" "$machine") + local machine_args=("-cpu" "max") + [ -n "$machine" ] && machine_args+=("-machine" "$machine") qemu_output="$INITRAMFS_ROOT/qemu.log" sane_run --pipe --timeout=3m \