Apparently qemu's ARM virt machine needs to be explicitly given a firmware
image, rather than just supplying a sane default. Unfortunately the EDK2
firmware image we need isn't in the same place on all host distros.
Currently the test scripts hardcode the Debian location, meaning it will
break on hosts that have it somewhere else. This patch adds a search which
will check both the Debian and Fedora locations, which makes it marginally
more robust.
Signed-off-by: David Gibson
---
test/distro/debian | 9 ++++++---
test/distro/fedora | 24 ++++++++++++++++--------
test/distro/opensuse | 3 ++-
3 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/test/distro/debian b/test/distro/debian
index 6c25f22..b389b9a 100644
--- a/test/distro/debian
+++ b/test/distro/debian
@@ -132,7 +132,8 @@ host guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init
host guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init-local
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
host PS1='$ '
sleep 2
host apt-get update
@@ -215,7 +216,8 @@ host guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init
host guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init-local
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep 2
host apt-get update
host apt-get -y install make gcc netcat-openbsd
@@ -286,7 +288,8 @@ tempimg IMG https://cloud.debian.org/images/cloud/sid/daily/latest/debian-sid-no
host virt-edit -a __IMG__ /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep 2
host apt-get update
host apt-get -y install make gcc netcat-openbsd
diff --git a/test/distro/fedora b/test/distro/fedora
index 904c987..718f3c7 100644
--- a/test/distro/fedora
+++ b/test/distro/fedora
@@ -154,7 +154,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
@@ -207,7 +208,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
@@ -260,7 +262,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
@@ -313,7 +316,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
@@ -366,7 +370,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
@@ -419,7 +424,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
@@ -472,7 +478,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
@@ -525,7 +532,8 @@ host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.se
host guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio -device virtio-rng-pci
host PS1='$ '
sleep 2
host yum -y install make gcc nmap-ncat
diff --git a/test/distro/opensuse b/test/distro/opensuse
index 617656d..14d6df2 100644
--- a/test/distro/opensuse
+++ b/test/distro/opensuse
@@ -129,7 +129,8 @@ host wget http://download.opensuse.org/ports/aarch64/tumbleweed/appliances/openS
host virt-edit -a __IMG__ -m /dev/sda3 /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --timeout 5000 --autologin root -i -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/
-host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio
+hout BIOS ls /usr/share/qemu-efi-aarch64/QEMU_EFI.fd /usr/share/edk2/aarch64/QEMU_EFI.fd 2>/dev/null || true
+host ./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios __BIOS__ -nodefaults -nographic -vga none -serial stdio __IMG__ -net socket,fd=5 -net nic,model=virtio
host PS1='$ '
host ip link set enp0s1 up
sleep 10
--
2.36.1