diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-05-25 14:33:42 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-05-25 14:33:42 +1000 |
commit | 23dcbc3adee2c6ea4e6c1149ef9fc6b59de581fa (patch) | |
tree | 3257e4ab0eeb1e24a35b4c03a0592ecc6d90fd29 /test | |
parent | 1978024139af7bd4451b1561f71abb57f7adc9d8 (diff) | |
download | skiboot-23dcbc3adee2c6ea4e6c1149ef9fc6b59de581fa.zip skiboot-23dcbc3adee2c6ea4e6c1149ef9fc6b59de581fa.tar.gz skiboot-23dcbc3adee2c6ea4e6c1149ef9fc6b59de581fa.tar.bz2 |
Refactor mambo test running
we now properly control the simulation rather than just killing off
Mambo. For boot test, we wait for petitboot and actually shut down
the simulation properly with 'halt'.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/hello_world/run_hello_world.sh | 7 | ||||
-rw-r--r-- | test/hello_world/run_hello_world.tcl | 4 | ||||
-rwxr-xr-x | test/run_boot_test.sh | 9 | ||||
-rw-r--r-- | test/run_boot_test.tcl | 16 |
4 files changed, 27 insertions, 9 deletions
diff --git a/test/hello_world/run_hello_world.sh b/test/hello_world/run_hello_world.sh index f72c402..e6f4d86 100755 --- a/test/hello_world/run_hello_world.sh +++ b/test/hello_world/run_hello_world.sh @@ -34,14 +34,13 @@ ulimit -c 0 ( cd external/mambo; cat <<EOF | expect set timeout 30 -spawn $MAMBO_PATH/$MAMBO_BINARY -n -f skiboot.tcl +spawn $MAMBO_PATH/$MAMBO_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 } -"Hello World!" +"ATTN" } - -close +wait exit 0 EOF ) diff --git a/test/hello_world/run_hello_world.tcl b/test/hello_world/run_hello_world.tcl new file mode 100644 index 0000000..e44fe16 --- /dev/null +++ b/test/hello_world/run_hello_world.tcl @@ -0,0 +1,4 @@ +source ../../external/mambo/skiboot.tcl + +mysim go +exit
\ No newline at end of file diff --git a/test/run_boot_test.sh b/test/run_boot_test.sh index 5a386a2..d1fb6d0 100755 --- a/test/run_boot_test.sh +++ b/test/run_boot_test.sh @@ -36,17 +36,16 @@ fi OLD_ULIMIT_C=`ulimit -c` ulimit -c 0 -( cd external/mambo; +( cd external/mambo; cat <<EOF | expect set timeout 600 -spawn $MAMBO_PATH/$MAMBO_BINARY -n -f skiboot.tcl +spawn $MAMBO_PATH/$MAMBO_BINARY -n -f ../../test/run_boot_test.tcl expect { timeout { send_user "\nTimeout waiting for petitboot\n"; exit 1 } eof { send_user "\nUnexpected EOF\n;" exit 1 } -"Welcome to Petitboot" +"Execution stopped: Sim Support exit requested stop" } - -close +wait exit 0 EOF ) diff --git a/test/run_boot_test.tcl b/test/run_boot_test.tcl new file mode 100644 index 0000000..81f2852 --- /dev/null +++ b/test/run_boot_test.tcl @@ -0,0 +1,16 @@ +source ../../external/mambo/skiboot.tcl + +proc console_trigger {response args} { + array set triginfo $args + set sim $triginfo(sim) + $sim trigger clear console $triginfo(match) + + puts "console trigger: putting $response to console" + $sim console create input in string $response +} + +mysim trigger set console "Welcome to Petitboot" { console_trigger "x" } +mysim trigger set console "# " { console_trigger "halt\n" } + +mysim go +exit
\ No newline at end of file |