summaryrefslogtreecommitdiffstats
path: root/scripts/test-msg.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/test-msg.sh37
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"
93wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell" 93wait_log "$LOG" "boot: entering shell" 90 || fail "kernel never reached the shell"
94 94
95echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)" 95echo "==> 4/5 drive the shell (msgrecv / send / mouse routing / queue-full)"
96# msgrecv spawns as task 3 (task 2 is the cursor task).
96python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \ 97python3 "$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.
109python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 2" 110python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" "mouse 3"
110qemu_hmp "mouse_move 20 7" 111qemu_hmp "mouse_move 20 7"
111qemu_hmp "mouse_button 1" 112qemu_hmp "mouse_button 1"
112qemu_hmp "mouse_move -5 -3" 113qemu_hmp "mouse_move -5 -3"
@@ -140,20 +141,20 @@ python3 "$SCRIPT_DIR/sendkeys.py" --sock "$SOCK" \
140echo "==> 5/5 wait for shutdown + verify" 141echo "==> 5/5 wait for shutdown + verify"
141wait_qemu_exit 30 || fail "QEMU did not exit after poweroff" 142wait_qemu_exit 30 || fail "QEMU did not exit after poweroff"
142 143
143grep -aq "msgrecv: task 2 listening" "$LOG" || fail "msgrecv did not spawn" 144grep -aq "msgrecv: task 3 listening" "$LOG" || fail "msgrecv did not spawn"
144grep -aq "msgrecv\[2\]: User(42)" "$LOG" || fail "user message missing" 145grep -aq "msgrecv\[3\]: User(42)" "$LOG" || fail "user message missing"
145grep -aq "msgrecv\[2\]: Timer" "$LOG" || fail "timer message missing" 146grep -aq "msgrecv\[3\]: Timer" "$LOG" || fail "timer message missing"
146grep -aq "msgrecv\[2\]: Key(Enter)" "$LOG" || fail "key enter missing" 147grep -aq "msgrecv\[3\]: Key(Enter)" "$LOG" || fail "key enter missing"
147grep -aq "msgrecv\[2\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing" 148grep -aq "msgrecv\[3\]: Key(Ctrl-c)" "$LOG" || fail "key ctrl-c missing"
148grep -aq "msgrecv\[2\]: Key(F3)" "$LOG" || fail "key f3 missing" 149grep -aq "msgrecv\[3\]: Key(F3)" "$LOG" || fail "key f3 missing"
149grep -aq "msgrecv\[2\]: Mouse(+5,-3 L R)" "$LOG" || fail "synthesized mouse message missing" 150grep -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).
151grep -aq "msgrecv\[2\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue" 152grep -aq "msgrecv\[3\]: Mouse(+20,+7" "$LOG" || fail "real mouse move 20,7 not routed to queue"
152grep -aq "msgrecv\[2\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing" 153grep -aq "msgrecv\[3\]: Mouse(-5,-3 L" "$LOG" || fail "held-button routed move missing"
153grep -aq "queue full" "$LOG" || fail "17th send did not report queue full" 154grep -aq "queue full" "$LOG" || fail "17th send did not report queue full"
154grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)" 155grep -aq "send: unknown type" "$LOG" && fail "a bad send slipped through (expected none)"
155 156
156echo "" 157echo ""
157echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)" 158echo "PASS — message queues OK (all types, ordering, real-input routing, queue-full)"
158echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full" 159echo " sent: user · timer · key(enter,ctrl-c,f3) · mouse · 16+1 queue-full"
159echo " routed: mouse_move 20,7 → queue → msgrecv[2]" 160echo " routed: mouse_move 20,7 → queue → msgrecv[3]"