diff options
Diffstat (limited to '')
| -rwxr-xr-x | scripts/test-msg.sh | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/scripts/test-msg.sh b/scripts/test-msg.sh index 0bd1c81..d81d8d7 100755 --- a/scripts/test-msg.sh +++ b/scripts/test-msg.sh | |||
| @@ -93,20 +93,21 @@ echo $! >"$QPID" | |||
| 93 | wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell" | 93 | wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell" |
| 94 | 94 | ||
| 95 | echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)" | 95 | echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)" |
| 96 | # msgrecv spawns as task 3 (task 2 is the cursor task). | ||
| 96 | python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ | 97 | python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ |
| 97 | "msgrecv" \ | 98 | "msgrecv" \ |
| 98 | "send 2 user 42" \ | 99 | "send 3 user 42" \ |
| 99 | "send 2 timer" \ | 100 | "send 3 timer" \ |
| 100 | "send 2 key enter" \ | 101 | "send 3 key enter" \ |
| 101 | "send 2 key ctrl-c" \ | 102 | "send 3 key ctrl-c" \ |
| 102 | "send 2 key f3" \ | 103 | "send 3 key f3" \ |
| 103 | "send 2 mouse 5 -3 3" \ | 104 | "send 3 mouse 5 -3 3" \ |
| 104 | "sleep 800" \ | 105 | "sleep 800" \ |
| 105 | "jobs" | 106 | "jobs" |
| 106 | 107 | ||
| 107 | # Real IRQ12 events through the queue: start routing to task 2, inject | 108 | # Real IRQ12 events through the queue: start routing to task 3, inject |
| 108 | # moves + a left press, stop. | 109 | # moves + a left press, stop. |
| 109 | python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 2" | 110 | python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 3" |
| 110 | qemu_hmp "mouse_move 20 7" | 111 | qemu_hmp "mouse_move 20 7" |
| 111 | qemu_hmp "mouse_button 1" | 112 | qemu_hmp "mouse_button 1" |
| 112 | qemu_hmp "mouse_move -5 -3" | 113 | qemu_hmp "mouse_move -5 -3" |
| @@ -140,20 +141,20 @@ python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ | |||
| 140 | echo "==> 5/5 wait for shutdown + verify" | 141 | echo "==> 5/5 wait for shutdown + verify" |
| 141 | wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" | 142 | wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" |
| 142 | 143 | ||
| 143 | grep -aq "msgrecv: task 2 listening" "$LOG" || fail "msgrecv did not spawn" | 144 | grep -aq "msgrecv: task 3 listening" "$LOG" || fail "msgrecv did not spawn" |
| 144 | grep -aq "msgrecv\[2\]: User(42)" "$LOG" || fail "user message missing" | 145 | grep -aq "msgrecv\[3\]: User(42)" "$LOG" || fail "user message missing" |
| 145 | grep -aq "msgrecv\[2\]: Timer" "$LOG" || fail "timer message missing" | 146 | grep -aq "msgrecv\[3\]: Timer" "$LOG" || fail "timer message missing" |
| 146 | grep -aq "msgrecv\[2\]: Key(Enter)" "$LOG" || fail "key enter missing" | 147 | grep -aq "msgrecv\[3\]: Key(Enter)" "$LOG" || fail "key enter missing" |
| 147 | grep -aq "msgrecv\[2\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing" | 148 | grep -aq "msgrecv\[3\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing" |
| 148 | grep -aq "msgrecv\[2\]: Key(F3)" "$LOG" || fail "key f3 missing" | 149 | grep -aq "msgrecv\[3\]: Key(F3)" "$LOG" || fail "key f3 missing" |
| 149 | grep -aq "msgrecv\[2\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing" | 150 | grep -aq "msgrecv\[3\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing" |
| 150 | # Real IRQ12 events routed through the queue (button held across the move). | 151 | # Real IRQ12 events routed through the queue (button held across the move). |
| 151 | grep -aq "msgrecv\[2\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue" | 152 | grep -aq "msgrecv\[3\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue" |
| 152 | grep -aq "msgrecv\[2\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing" | 153 | grep -aq "msgrecv\[3\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing" |
| 153 | grep -aq "queue full" "$LOG" || fail "17th send did not report queue full" | 154 | grep -aq "queue full" "$LOG" || fail "17th send did not report queue full" |
| 154 | grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)" | 155 | grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)" |
| 155 | 156 | ||
| 156 | echo "" | 157 | echo "" |
| 157 | echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)" | 158 | echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)" |
| 158 | echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full" | 159 | echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full" |
| 159 | echo " routed: mouse_move 20,7 → queue → msgrecv[2]" | 160 | echo " routed: mouse_move 20,7 → queue → msgrecv[3]" |
