diff options
author | Joel Stanley <joel@jms.id.au> | 2018-05-02 16:48:07 +0930 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-05-02 20:01:34 -0500 |
commit | 973391504789efcab8e01c2b974f5ceb7f564bee (patch) | |
tree | 8afeb8e689d143aa587f97677871760d05b12d44 | |
parent | 3ef38a3895e682627bcdafdeec8796db3f9bdaf9 (diff) | |
download | skiboot-973391504789efcab8e01c2b974f5ceb7f564bee.zip skiboot-973391504789efcab8e01c2b974f5ceb7f564bee.tar.gz skiboot-973391504789efcab8e01c2b974f5ceb7f564bee.tar.bz2 |
tests: Specfiy Qemu with a single environment variable
This allows Qemu to work out of the box if the user has an appropriate
Qemu installed.
Support for running TCG power guests has come a long way from when we
first added these test scripts. It makes sense to use the system Qemu
where possible, as for most people this will succeed.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rwxr-xr-x | test/hello_world/run_qemu_hello_world.sh | 14 | ||||
-rwxr-xr-x | test/run_qemu-jessie-debian-installer_boot_test.sh | 14 | ||||
-rwxr-xr-x | test/run_qemu_boot_test.sh | 14 |
3 files changed, 15 insertions, 27 deletions
diff --git a/test/hello_world/run_qemu_hello_world.sh b/test/hello_world/run_qemu_hello_world.sh index e08f851..cc5055e 100755 --- a/test/hello_world/run_qemu_hello_world.sh +++ b/test/hello_world/run_qemu_hello_world.sh @@ -1,16 +1,12 @@ #!/bin/bash -if [ -z "$QEMU_PATH" ]; then - QEMU_PATH=`pwd`/opal-ci/qemu/ppc64-softmmu/ +if [ -z "$QEMU" ]; then + QEMU="qemu-system-ppc64" fi -if [ -z "$QEMU_BINARY" ]; then - QEMU_BINARY="qemu-system-ppc64" -fi - -if [ ! -x "$QEMU_PATH/$QEMU_BINARY" ]; then - echo 'Could not find executable QEMU_BINARY. Skipping hello_world test'; +if [ ! `command -v $QEMU` ]; then + echo 'Could not find executable QEMU. Skipping hello_world test'; exit 0; fi @@ -34,7 +30,7 @@ trap "rm -f -- '$t'" EXIT ( cat <<EOF | expect set timeout 30 -spawn $QEMU_PATH/$QEMU_BINARY -m 1G -M powernv -kernel $SKIBOOT_ZIMAGE -nographic +spawn $QEMU -m 1G -M powernv -kernel $SKIBOOT_ZIMAGE -nographic expect { timeout { send_user "\nTimeout waiting for hello world\n"; exit 1 } eof { send_user "\nUnexpected EOF\n;" exit 1 } diff --git a/test/run_qemu-jessie-debian-installer_boot_test.sh b/test/run_qemu-jessie-debian-installer_boot_test.sh index ab9ca85..57e9d82 100755 --- a/test/run_qemu-jessie-debian-installer_boot_test.sh +++ b/test/run_qemu-jessie-debian-installer_boot_test.sh @@ -1,16 +1,12 @@ #!/bin/bash -if [ -z "$QEMU_PATH" ]; then - QEMU_PATH=`pwd`/opal-ci/qemu/ppc64-softmmu/ +if [ -z "$QEMU" ]; then + QEMU="qemu-system-ppc64" fi -if [ -z "$QEMU_BINARY" ]; then - QEMU_BINARY="qemu-system-ppc64" -fi - -if [ ! -x "$QEMU_PATH/$QEMU_BINARY" ]; then - echo 'Could not find executable QEMU_BINARY. Skipping hello_world test'; +if [ ! `command -v qemu-system-ppc64` ]; then + echo 'Could not find executable QEMU. Skipping hello_world test'; exit 0; fi @@ -44,7 +40,7 @@ $QEMU_PATH/../qemu-img create -f qcow2 $D 128G 2>&1 > $T ( cat <<EOF | expect set timeout 600 -spawn $QEMU_PATH/$QEMU_BINARY -m 2G -M powernv -kernel debian-jessie-vmlinux -initrd debian-jessie-initrd.gz -nographic -device ipmi-bmc-sim,id=ipmi0 -device isa-ipmi-bt,bmc=ipmi0 -hda $D +spawn $QEMU -m 2G -M powernv -kernel debian-jessie-vmlinux -initrd debian-jessie-initrd.gz -nographic -device ipmi-bmc-sim,id=ipmi0 -device isa-ipmi-bt,bmc=ipmi0 -hda $D expect { timeout { send_user "\nTimeout waiting for petitboot\n"; exit 1 } eof { send_user "\nUnexpected EOF\n;" exit 1 } diff --git a/test/run_qemu_boot_test.sh b/test/run_qemu_boot_test.sh index b984afc..c3a7933 100755 --- a/test/run_qemu_boot_test.sh +++ b/test/run_qemu_boot_test.sh @@ -1,16 +1,12 @@ #!/bin/bash -if [ -z "$QEMU_PATH" ]; then - QEMU_PATH=`pwd`/opal-ci/qemu/ppc64-softmmu/ +if [ -z "$QEMU" ]; then + QEMU="qemu-system-ppc64" fi -if [ -z "$QEMU_BINARY" ]; then - QEMU_BINARY="qemu-system-ppc64" -fi - -if [ ! -x "$QEMU_PATH/$QEMU_BINARY" ]; then - echo 'Could not find executable QEMU_BINARY. Skipping hello_world test'; +if [ ! `command -v qemu-system-ppc64` ]; then + echo 'Could not find executable QEMU. Skipping hello_world test'; exit 0; fi @@ -37,7 +33,7 @@ T=`mktemp --tmpdir skiboot_qemu_boot_test.XXXXXXXXXX` ( cat <<EOF | expect set timeout 600 -spawn $QEMU_PATH/$QEMU_BINARY -m 3G -M powernv -kernel $SKIBOOT_ZIMAGE -nographic -device ipmi-bmc-sim,id=ipmi0 -device isa-ipmi-bt,bmc=ipmi0 +spawn $QEMU -m 3G -M powernv -kernel $SKIBOOT_ZIMAGE -nographic -device ipmi-bmc-sim,id=ipmi0 -device isa-ipmi-bt,bmc=ipmi0 expect { timeout { send_user "\nTimeout waiting for petitboot\n"; exit 1 } eof { send_user "\nUnexpected EOF\n;" exit 1 } |