[Skiboot] [PATCH v2] hello_world: Add p10 mambo tests
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Fri Aug 20 01:40:39 AEST 2021
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
Changes in v2:
I had missed to add run_mambo_p10_hello_world.sh in v1.
-Vasant
test/hello_world/Makefile.check | 16 +++++
test/hello_world/run_mambo_p10_hello_world.sh | 64 +++++++++++++++++++
2 files changed, 80 insertions(+)
create mode 100755 test/hello_world/run_mambo_p10_hello_world.sh
diff --git a/test/hello_world/Makefile.check b/test/hello_world/Makefile.check
index 0390cf662..8cf15cb2f 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 000000000..4ce54494d
--- /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;
--
2.31.1
More information about the Skiboot
mailing list