diff --git a/scripts/e2e/parallels-macos-smoke.sh b/scripts/e2e/parallels-macos-smoke.sh index 1c3b1c05897..d5cb3f8b05d 100644 --- a/scripts/e2e/parallels-macos-smoke.sh +++ b/scripts/e2e/parallels-macos-smoke.sh @@ -1276,23 +1276,42 @@ start_manual_gateway_if_needed() { if ! headless_guest_fallback; then return 0 fi - local gateway_log guest_home + local gateway_log guest_gateway_log guest_home launch_cmd guest_home="$(parallels_macos_resolve_desktop_home "$VM_NAME" "$GUEST_CURRENT_USER")" gateway_log="$RUN_DIR/macos-gateway-prlctl.log" + guest_gateway_log="/tmp/openclaw-parallels-macos-gateway.log" guest_current_user_exec /usr/bin/pkill -f 'openclaw.*gateway run' >/dev/null 2>&1 || true guest_current_user_exec /usr/bin/pkill -f 'openclaw-gateway' >/dev/null 2>&1 || true guest_current_user_exec /usr/bin/pkill -f 'openclaw.mjs gateway' >/dev/null 2>&1 || true - /usr/bin/nohup prlctl exec "$VM_NAME" /usr/bin/sudo -H -u "$GUEST_CURRENT_USER" /usr/bin/env \ - "HOME=$guest_home" \ - "USER=$GUEST_CURRENT_USER" \ - "LOGNAME=$GUEST_CURRENT_USER" \ - "PATH=$GUEST_EXEC_PATH" \ - "$API_KEY_ENV=$API_KEY_VALUE" \ - "OPENCLAW_HOME=$guest_home" \ - "OPENCLAW_STATE_DIR=$guest_home/.openclaw" \ - "OPENCLAW_CONFIG_PATH=$guest_home/.openclaw/openclaw.json" \ - "$GUEST_NODE_BIN" "$GUEST_OPENCLAW_ENTRY" gateway run --bind loopback --port 18789 --force \ - >"$gateway_log" 2>&1 & + launch_cmd="$(cat <$(shell_quote "$guest_gateway_log") 2>&1 & +gateway_pid="\$!" +printf 'guest gateway pid %s\n' "\$gateway_pid" +printf 'guest gateway log %s\n' $(shell_quote "$guest_gateway_log") +sleep 1 +if ! kill -0 "\$gateway_pid" >/dev/null 2>&1; then + tail -n 120 $(shell_quote "$guest_gateway_log") >&2 || true + exit 1 +fi +EOF +)" + if ! guest_current_user_sh "$launch_cmd" >"$gateway_log" 2>&1; then + cat "$gateway_log" >&2 || true + return 1 + fi + cat "$gateway_log" } verify_gateway() {