File tree Expand file tree Collapse file tree 6 files changed +17
-25
lines changed
Expand file tree Collapse file tree 6 files changed +17
-25
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ TEST_MAGIC_WANT="9A11C824"
55
66source tests/lib.sh
77
8- os_test_up " ${TEST_INJECT_WORD:? } " || exit -1
8+ os_test_up " ${TEST_MAGIC_WANT :? } " " ${ TEST_INJECT_WORD:? }" || exit -1
99
1010# Test
1111set -e
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ TEST_MAGIC_WANT="198A65C3"
55
66source tests/lib.sh
77
8- os_test_up " ${TEST_INJECT_WORD:? } " || exit -1
8+ os_test_up " ${TEST_MAGIC_WANT :? } " " ${ TEST_INJECT_WORD:? }" || exit -1
99
1010# Test
1111set -e
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ TEST_MAGIC_WANT="922E52FF"
55
66source tests/lib.sh
77
8- os_test_up " ${TEST_INJECT_WORD:? } " || exit -1
8+ os_test_up " ${TEST_MAGIC_WANT :? } " " ${ TEST_INJECT_WORD:? }" || exit -1
99
1010# Test
1111set -e
Original file line number Diff line number Diff line change @@ -34,21 +34,24 @@ function sync_to_src_test() {
3434
3535
3636# ##################################################
37- # Turn up OS in QEMU and wait for $TEST_MAGIC_WANT.
37+ # Turn up OS in QEMU and wait for Magic Word
3838# Globals:
39- # TEST_MAGIC_WANT
4039# COMMAND_OUTPUT
4140# SCREEN_CONTENT
4241# QEMU_PID
4342# Arguments:
43+ # Magic Word
4444# Inject Keyword
4545# Outputs:
4646# Logs
4747# Returns:
4848# 0 on success, non-zero on error.
4949# ##################################################
5050function os_test_up() {
51- sync_to_src_test " $1 "
51+ magic_word=" $1 "
52+ test_inject_keyword=" $2 "
53+
54+ sync_to_src_test " ${test_inject_keyword:? } "
5255
5356 # Turn up QEMU in background
5457 make qemu \
@@ -69,13 +72,13 @@ function os_test_up() {
6972
7073 # Keep polling QEMU monitor until we get our magic word!
7174 COMMAND_OUTPUT=" "
72- echo " Sending commands to QEMU and polling for the magic word '$1 ' every second."
75+ echo " Sending commands to QEMU and polling for the magic word '${magic_word :? } ' every second."
7376 while true ; do
74- sleep 1m; # temporarily mitigation.
7577 COMMAND_OUTPUT=" $( echo -e ' screendump ' ${QEMU_SCREENSHOT:? } ' \nprint $eax\nquit' | \
7678 nc 127.0.0.1 ${MONITOR_PORT:? } | tr -d ' \0' ) "
79+ echo " QEMU monitor response: ${COMMAND_OUTPUT:? } "
7780 echo " $COMMAND_OUTPUT " | \
78- grep -i " $TEST_MAGIC_WANT " && \
81+ grep -i " ${magic_word :? } " && \
7982 echo " Magic Word Found! Continuing the test..." && \
8083 break
8184 sleep 1s
Original file line number Diff line number Diff line change 22set -e
33
44# Execute Tests
5- bash tests/bootloader_stage1_test.sh
6- bash tests/bootloader_stage2_test.sh
7- bash tests/kernel_core_entry_test.sh
5+ timeout 2m bash tests/bootloader_stage1_test.sh
6+ timeout 2m bash tests/bootloader_stage2_test.sh
7+
8+ # TODO: Temporarily disabling following tests, until they are ready.
9+ # timeout 2m bash tests/kernel_core_entry_test.sh
810
911# Done
1012echo " All tests passed!"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments