



























@@ -83,6 +83,8 @@ run_wizard_cmd failing-wizard fake-state "node fake-wizard" send_noop false
8383'ONBOARD_TMP_DIR="$(mktemp -d "$ONBOARD_TMP_ROOT/openclaw-onboard.XXXXXX")"',
8484);
8585expect(contents).toContain('OPENCLAW_E2E_LOG_DIR="$ONBOARD_TMP_DIR/logs"');
86+expect(contents).toContain('GATEWAY_LOG_PATH="$ONBOARD_TMP_DIR/gateway-e2e.log"');
87+expect(contents).not.toContain("/tmp/gateway-e2e.log");
8688expect(contents).toContain('validate_local_basic_log "$OPENCLAW_E2E_LAST_LOG_PATH"');
8789expect(contents).not.toContain(
8890"validate_local_basic_log /tmp/openclaw-onboard-local-basic.log",
@@ -91,4 +93,43 @@ run_wizard_cmd failing-wizard fake-state "node fake-wizard" send_noop false
9193'openclaw_e2e_assert_log_not_contains "$log_path" "systemctl --user unavailable"',
9294);
9395});
96+97+it("probes onboarding gateway readiness through the isolated scratch log", async () => {
98+const tempRoot = await mkdtemp(path.join(tmpdir(), "openclaw-onboard-gateway-log-"));
99+const fixturePath = path.join(tempRoot, "gateway-log.sh");
100+await writeFile(
101+fixturePath,
102+`#!/usr/bin/env bash
103+set -euo pipefail
104+105+export OPENCLAW_ONBOARD_SCENARIO_SOURCE_ONLY=1
106+export OPENCLAW_ONBOARD_E2E_TMPDIR=${JSON.stringify(tempRoot)}
107+OPENCLAW_ENTRY=node
108+source scripts/e2e/lib/onboard/scenario.sh
109+110+openclaw_e2e_probe_tcp() { return 1; }
111+sleep 30 &
112+GATEWAY_PID="$!"
113+printf 'listening on ws://127.0.0.1:18789\\n' >"$GATEWAY_LOG_PATH"
114+wait_for_gateway
115+case "$GATEWAY_LOG_PATH" in
116+ "$ONBOARD_TMP_DIR"/*) ;;
117+ *) echo "gateway log escaped scratch root: $GATEWAY_LOG_PATH" >&2; exit 1 ;;
118+esac
119+cleanup_onboard_artifacts
120+test ! -e "$ONBOARD_TMP_DIR"
121+`,
122+);
123+124+try {
125+const result = spawnSync("bash", [fixturePath], {
126+cwd: process.cwd(),
127+encoding: "utf8",
128+});
129+130+expect(result.status, `${result.stdout}\n${result.stderr}`).toBe(0);
131+} finally {
132+await rm(tempRoot, { force: true, recursive: true });
133+}
134+});
94135});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。