diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-01-27 09:30:03 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-01-27 09:30:03 +1100 |
commit | f6ce99ac602ca2cd3497de48da6717a49b5e466f (patch) | |
tree | 20ebd51c7ec2e6ae1b930a4c3b4074fd6929f09a /test | |
parent | f48846304976061aed5784659c299bc4cb9b681e (diff) | |
download | skiboot-f6ce99ac602ca2cd3497de48da6717a49b5e466f.zip skiboot-f6ce99ac602ca2cd3497de48da6717a49b5e466f.tar.gz skiboot-f6ce99ac602ca2cd3497de48da6717a49b5e466f.tar.bz2 |
Add Makefile and shell to run a boot test if zImage.epapr is present
If you've built a zImage.epapr using op-build, you can now drop it
in the top level skiboot source tree, run 'make check' and these
test files will pick it up and run a boot test using it.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.check | 4 | ||||
-rwxr-xr-x | test/run_boot_test.sh | 55 |
2 files changed, 59 insertions, 0 deletions
diff --git a/test/Makefile.check b/test/Makefile.check new file mode 100644 index 0000000..6402f95 --- /dev/null +++ b/test/Makefile.check @@ -0,0 +1,4 @@ +check: boot-check + +boot-check: skiboot.lid + ./test/run_boot_test.sh diff --git a/test/run_boot_test.sh b/test/run_boot_test.sh new file mode 100755 index 0000000..5a386a2 --- /dev/null +++ b/test/run_boot_test.sh @@ -0,0 +1,55 @@ +#!/bin/bash + + +if [ -z "$MAMBO_PATH" ]; then + MAMBO_PATH=/opt/ibm/systemsim-p8/ +fi + +if [ -z "$MAMBO_BINARY" ]; then + MAMBO_BINARY="/run/pegasus/power8" +fi + +if [ ! -x "$MAMBO_PATH/$MAMBO_BINARY" ]; then + echo 'Could not find executable MAMBO_BINARY. Skipping hello_world test'; + exit 0; +fi + +if [ -n "$KERNEL" ]; then + echo 'Please rebuild skiboot without KERNEL set. Skipping hello_world test'; + exit 0; +fi + +if [ ! `command -v expect` ]; then + echo 'Could not find expect binary. Skipping hello_world test'; + exit 0; +fi + + +export SKIBOOT_ZIMAGE=`pwd`/zImage.epapr + +if [ ! -f "$SKIBOOT_ZIMAGE" ]; then + echo 'No zImage.epapr, skipping boot test'; + exit 0; +fi + +# Currently getting some core dumps from mambo, so disable them! +OLD_ULIMIT_C=`ulimit -c` +ulimit -c 0 + +( cd external/mambo; +cat <<EOF | expect +set timeout 600 +spawn $MAMBO_PATH/$MAMBO_BINARY -n -f skiboot.tcl +expect { +timeout { send_user "\nTimeout waiting for petitboot\n"; exit 1 } +eof { send_user "\nUnexpected EOF\n;" exit 1 } +"Welcome to Petitboot" +} + +close +exit 0 +EOF +) +ulimit -c $OLD_ULIMIT_C +echo +exit 0; |