diff options
author | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2021-08-19 21:10:39 +0530 |
---|---|---|
committer | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2021-08-27 12:13:12 +0530 |
commit | 6352fa85e23f3c620544edcb3feb971d3babd746 (patch) | |
tree | 46391250379fc40b9a38d2fee05176fe8736e1bb | |
parent | 39f12eb08ec492574cd4ea511f0e5f11f026503b (diff) | |
download | skiboot-6352fa85e23f3c620544edcb3feb971d3babd746.zip skiboot-6352fa85e23f3c620544edcb3feb971d3babd746.tar.gz skiboot-6352fa85e23f3c620544edcb3feb971d3babd746.tar.bz2 |
hello_world: Add p10 mambo tests
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r-- | test/hello_world/Makefile.check | 16 | ||||
-rwxr-xr-x | test/hello_world/run_mambo_p10_hello_world.sh | 64 |
2 files changed, 80 insertions, 0 deletions
diff --git a/test/hello_world/Makefile.check b/test/hello_world/Makefile.check index 0390cf6..8cf15cb 100644 --- a/test/hello_world/Makefile.check +++ b/test/hello_world/Makefile.check @@ -4,14 +4,18 @@ HELLO_WORLD_STB_TEST := test/hello_world/hello_kernel/hello_kernel.stb .PHONY: hello_world-tests hello_world-tests: $(HELLO_WORLD_TEST:%=%-check-smt-mambo) hello_world-tests: $(HELLO_WORLD_TEST:%=%-check-smt-p9-mambo) +hello_world-tests: $(HELLO_WORLD_TEST:%=%-check-smt-p10-mambo) hello_world-tests: $(HELLO_WORLD_TEST:%=%-check-mambo) hello_world-tests: $(HELLO_WORLD_TEST:%=%-check-p9-mambo) +hello_world-tests: $(HELLO_WORLD_TEST:%=%-check-p10-mambo) hello_world-tests: $(HELLO_WORLD_TEST:%=%-check-qemu) hello_world-tests: $(HELLO_WORLD_STB_TEST:%=%-check-stb-smt-mambo) hello_world-tests: $(HELLO_WORLD_STB_TEST:%=%-check-stb-smt-p9-mambo) +hello_world-tests: $(HELLO_WORLD_STB_TEST:%=%-check-stb-smt-p10-mambo) hello_world-tests: $(HELLO_WORLD_STB_TEST:%=%-check-stb-mambo) hello_world-tests: $(HELLO_WORLD_STB_TEST:%=%-check-stb-p9-mambo) +hello_world-tests: $(HELLO_WORLD_STB_TEST:%=%-check-stb-p10-mambo) boot-tests: hello_world-tests check: hello_world-tests @@ -29,12 +33,18 @@ $(HELLO_WORLD_TEST:%=%-check-smt-mambo): %-check-smt-mambo: % skiboot.lid $(HELLO_WORLD_TEST:%=%-check-smt-p9-mambo): %-check-smt-p9-mambo: % skiboot.lid $(call Q , BOOT TEST , THREADS=2 ./test/hello_world/run_mambo_p9_hello_world.sh , $@) +$(HELLO_WORLD_TEST:%=%-check-smt-p10-mambo): %-check-smt-p10-mambo: % skiboot.lid + $(call Q , BOOT TEST , THREADS=2 ./test/hello_world/run_mambo_p10_hello_world.sh , $@) + $(HELLO_WORLD_TEST:%=%-check-mambo): %-check-mambo: % skiboot.lid $(call Q , BOOT TEST , ./test/hello_world/run_mambo_hello_world.sh, $@) $(HELLO_WORLD_TEST:%=%-check-p9-mambo): %-check-p9-mambo: % skiboot.lid $(call Q , BOOT TEST , ./test/hello_world/run_mambo_p9_hello_world.sh, $@) +$(HELLO_WORLD_TEST:%=%-check-p10-mambo): %-check-p10-mambo: % skiboot.lid + $(call Q , BOOT TEST , ./test/hello_world/run_mambo_p10_hello_world.sh, $@) + # and now, with secure and trusted boot: $(HELLO_WORLD_STB_TEST:%=%-check-stb-smt-mambo): %-check-stb-smt-mambo: % skiboot.lid.stb $(call Q , BOOT TEST , SKIBOOT_ENABLE_MAMBO_STB=1 THREADS=2 ./test/hello_world/run_mambo_hello_world.sh , $@) @@ -42,12 +52,18 @@ $(HELLO_WORLD_STB_TEST:%=%-check-stb-smt-mambo): %-check-stb-smt-mambo: % skiboo $(HELLO_WORLD_STB_TEST:%=%-check-stb-smt-p9-mambo): %-check-stb-smt-p9-mambo: % skiboot.lid.stb $(call Q , BOOT TEST , SKIBOOT_ENABLE_MAMBO_STB=1 THREADS=2 ./test/hello_world/run_mambo_p9_hello_world.sh , $@) +$(HELLO_WORLD_STB_TEST:%=%-check-stb-smt-p10-mambo): %-check-stb-smt-p10-mambo: % skiboot.lid.stb + $(call Q , BOOT TEST , SKIBOOT_ENABLE_MAMBO_STB=1 THREADS=2 ./test/hello_world/run_mambo_p10_hello_world.sh , $@) + $(HELLO_WORLD_STB_TEST:%=%-check-stb-mambo): %-check-stb-mambo: % skiboot.lid.stb $(call Q , BOOT TEST , SKIBOOT_ENABLE_MAMBO_STB=1 ./test/hello_world/run_mambo_hello_world.sh, $@) $(HELLO_WORLD_STB_TEST:%=%-check-stb-p9-mambo): %-check-stb-p9-mambo: % skiboot.lid.stb $(call Q , BOOT TEST , SKIBOOT_ENABLE_MAMBO_STB=1 ./test/hello_world/run_mambo_p9_hello_world.sh, $@) +$(HELLO_WORLD_STB_TEST:%=%-check-stb-p10-mambo): %-check-stb-p10-mambo: % skiboot.lid.stb + $(call Q , BOOT TEST , SKIBOOT_ENABLE_MAMBO_STB=1 ./test/hello_world/run_mambo_p10_hello_world.sh, $@) + # qemu $(HELLO_WORLD_TEST:%=%-check-qemu): %-check-qemu: % skiboot.lid diff --git a/test/hello_world/run_mambo_p10_hello_world.sh b/test/hello_world/run_mambo_p10_hello_world.sh new file mode 100755 index 0000000..4ce5449 --- /dev/null +++ b/test/hello_world/run_mambo_p10_hello_world.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +if [ -z "$P10MAMBO_PATH" ]; then + P10MAMBO_PATH=/opt/ibm/systemsim-p10-1.1-0 +fi + +if [ -z "$P10MAMBO_BINARY" ]; then + P10MAMBO_BINARY="run/p10/power10" +fi + +if [ ! -x "$P10MAMBO_PATH/$P10MAMBO_BINARY" ]; then + echo "Could not find executable P10MAMBO_BINARY ($P10MAMBO_PATH/$P10MAMBO_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 + +if [ -n "$SKIBOOT_ENABLE_MAMBO_STB" ]; then + export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel.stb + export SKIBOOT_CVC_CODE=$(pwd)/external/mambo/cvc.bin +else + export SKIBOOT_ZIMAGE=$(pwd)/test/hello_world/hello_kernel/hello_kernel +fi + +# Currently getting some core dumps from mambo, so disable them! +ulimit -c 0 + +t=$(mktemp) || exit 1 + +trap "rm -f -- '$t'" EXIT + +( cd external/mambo; +cat <<EOF | expect +set timeout 30 +spawn $P10MAMBO_PATH/$P10MAMBO_BINARY -n -f ../../test/hello_world/run_hello_world.tcl +expect { +timeout { send_user "\nTimeout waiting for hello world\n"; exit 1 } +eof { send_user "\nUnexpected EOF\n;" exit 1 } +"Machine Check Stop" { exit 1;} +"Execution stopped: Sim Support exit requested stop" +} +wait +exit 0 +EOF +) 2>&1 > $t + +r=$? +if [ $r != 0 ]; then + cat $t + exit $r +fi + +if [ -n "$V" ] ; then cat "$t" ; fi +rm -f -- "$t" +trap - EXIT +exit 0; |