Skip to content

Commit 486cb65

Browse files
committed
M3: cli stage uses robust boot_macintosh against the CLI-launched VM's monitor socket
1 parent ef5dafe commit 486cb65

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

scripts/build-qemu-macos.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,16 +346,22 @@ stage_cli() { # M3: clone+launch tahoe:26 via the Go CLI (cocoon-macos vm run),
346346
--ovmf-vars "$OSX_KVM_DIR/OVMF_VARS-1920x1080.fd" \
347347
--state-dir "$sd" || { log "cocoon-macos vm run failed"; return 1; }
348348
"$WORKDIR/cocoon-macos" vm list --state-dir "$sd"
349+
# point the boot/screenshot helpers at the CLI-launched VM's sockets, then boot like verify
350+
MON_SOCK="$sd/vms/t1/monitor.sock"
351+
QMP_SOCK="$sd/vms/t1/qmp.sock"
349352
QEMU_PID="$(cat "$sd/vms/t1/qemu.pid" 2>/dev/null || echo "")"
350-
log "CLI launched VM (pid $QEMU_PID); OpenCore auto-boots macOS; waiting for SSH"
351-
sleep 180
353+
log "CLI launched VM (pid $QEMU_PID); booting macOS"
354+
boot_macintosh
355+
log "waiting for SSH on the CLI-launched VM"
352356
local ok="" w
357+
for w in $(seq 1 8); do python3 "$QMP_PY" "$QMP_SOCK" move $((60 + w * 20)) 400 2>/dev/null || true; sleep 20; done
353358
for w in $(seq 1 12); do
354359
if sshpass -p cocoon ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=8 \
355360
-p "$SSH_PORT" cocoon@localhost 'sw_vers; hostname; id' >"$ARTIFACT_DIR/cli-ssh.txt" 2>&1; then
356361
ok=1; log "M3 CLI SSH OK:"; cat "$ARTIFACT_DIR/cli-ssh.txt"; break
357362
fi
358-
log "CLI SSH attempt $w not ready"; sleep 30
363+
log "CLI SSH attempt $w not ready"; sleep 25
364+
python3 "$QMP_PY" "$QMP_SOCK" move $((60 + w * 15)) 420 2>/dev/null || true
359365
done
360366
[[ -n "$ok" ]] && log "=== M3 PASS: cocoon-macos vm run clones + boots macOS + SSH works ===" \
361367
|| log "M3 CLI: SSH not reachable (inspect $ARTIFACT_DIR/cli-ssh.txt)"

0 commit comments

Comments
 (0)