aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2021-11-08 18:45:44 +0100
committerCédric Le Goater <clg@kaod.org>2021-11-09 20:22:58 +0100
commitd7cc47e5bc15c231cd92c666fe13a04f638cd904 (patch)
tree920a0f87417abf5a2c52d9c84e0eeffebaf13b48
parent638cf7345012fdf20beadb173a75f8e9f462f220 (diff)
downloadskiboot-d7cc47e5bc15c231cd92c666fe13a04f638cd904.zip
skiboot-d7cc47e5bc15c231cd92c666fe13a04f638cd904.tar.gz
skiboot-d7cc47e5bc15c231cd92c666fe13a04f638cd904.tar.bz2
test/qemu: Add PCI devices
This defines a PCI layout close to an OpenPOWER system and adds an optional disk to boot from. Fix verbose runs while we are at it. Signed-off-by: Cédric Le Goater <clg@kaod.org>
-rwxr-xr-xtest/run_qemu_boot_test.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/run_qemu_boot_test.sh b/test/run_qemu_boot_test.sh
index aefd911..d682a07 100755
--- a/test/run_qemu_boot_test.sh
+++ b/test/run_qemu_boot_test.sh
@@ -2,6 +2,10 @@
QEMU_ARGS="-M powernv -nodefaults -device ipmi-bmc-sim,id=bmc0 -serial none"
QEMU_ARGS+=" -device isa-serial,chardev=s1 -chardev stdio,id=s1,signal=off"
+QEMU_ARGS+=" -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0"
+QEMU_ARGS+=" -device ich9-ahci,id=sata0,bus=pcie.0,addr=0x0"
+QEMU_ARGS+=" -device e1000e,netdev=net0,bus=bridge1,addr=0x3 -netdev user,id=net0"
+QEMU_ARGS+=" -device nec-usb-xhci,bus=bridge1,addr=0x2"
QEMU_ARGS+=" -nographic"
if [ -z "$QEMU_BIN" ]; then
@@ -32,6 +36,20 @@ if [ ! -f "$SKIBOOT_ZIMAGE" ]; then
exit 0;
fi
+if [ -z "$DISK_IMAGE" ]; then
+ export DISK_IMAGE="$(pwd)/debian-11-generic-ppc64el.qcow2"
+fi
+
+WAIT_FOR="Welcome to Petitboot"
+
+if [ -f "$DISK_IMAGE" ]; then
+ QEMU_ARGS+=" -drive file=$DISK_IMAGE,if=none,id=drive0,format=qcow2,cache=none"
+ QEMU_ARGS+=" -device ide-hd,bus=sata0.0,unit=0,drive=drive0,id=ide,bootindex=1"
+
+ # TODO: Find a generic way to check that disk was read
+ WAIT_FOR="(*) Debian GNU/Linux"
+fi
+
T=$(mktemp --tmpdir skiboot_qemu_boot_test.XXXXXXXXXX)
( cat <<EOF | expect
@@ -43,7 +61,7 @@ eof { send_user "\nUnexpected EOF\n"; exit 1 }
"Could not load OPAL firmware" { send_user "\nSkiboot is too large for this Qemu, skipping\n"; exit 4; }
"Machine Check Stop" { exit 1; }
"Trying to write privileged spr 338" { send_user "\nUpgrade Qemu: needs PCR register\n"; exit 3 }
-"Welcome to Petitboot"
+"$WAIT_FOR"
}
close
wait
@@ -64,7 +82,7 @@ if [ $E -eq 3 ]; then
exit 0;
fi
-if [ -n "$V" ] ; then cat "$t" ; fi
+if [ -n "$V" ] ; then cat "$T" ; fi
if [ $E -eq 0 ]; then
rm $T
else