mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 12:56:01 -06:00
fix(e2e): align service account state (#116254)
This commit is contained in:
committed by
GitHub
parent
7df05d5fc0
commit
62cbbcc800
@@ -4390,7 +4390,12 @@ heartbeat_elapsed="\${BASH_REMATCH[1]}"
|
||||
|
||||
expectTextToIncludeAll(scenario, [
|
||||
'command_timeout="${OPENCLAW_DOCKER_DOCTOR_SWITCH_COMMAND_TIMEOUT:-900s}"',
|
||||
'openclaw_test_state_create "$account_home" empty\n unset OPENCLAW_HOME OPENCLAW_STATE_DIR OPENCLAW_CONFIG_PATH',
|
||||
[
|
||||
'openclaw_test_state_create "$account_home" empty',
|
||||
' export HOME="$account_home"',
|
||||
' export USERPROFILE="$account_home"',
|
||||
" unset OPENCLAW_HOME OPENCLAW_STATE_DIR OPENCLAW_CONFIG_PATH",
|
||||
].join("\n"),
|
||||
"create_default_service_state",
|
||||
'openclaw_e2e_maybe_timeout "$command_timeout" bash -c "$install_cmd"',
|
||||
'openclaw_e2e_maybe_timeout "$command_timeout" bash -c "$doctor_cmd"',
|
||||
@@ -4401,9 +4406,28 @@ heartbeat_elapsed="\${BASH_REMATCH[1]}"
|
||||
expect(
|
||||
scenario.match(/unset OPENCLAW_HOME OPENCLAW_STATE_DIR OPENCLAW_CONFIG_PATH/gu),
|
||||
).toHaveLength(1);
|
||||
expect(scenario.match(/export USERPROFILE="\$account_home"/gu)).toHaveLength(1);
|
||||
expect(scenario).not.toMatch(/^\s*if ! timeout "\$command_timeout"/mu);
|
||||
});
|
||||
|
||||
it("uses the account home for upgrade survivor auto-auth state", () => {
|
||||
const runner = readFileSync(UPGRADE_SURVIVOR_RUN_SCRIPT, "utf8");
|
||||
|
||||
expectTextToIncludeAll(runner, [
|
||||
'if [ "$UPDATE_RESTART_MODE" = "auto-auth" ]; then',
|
||||
'account_home="$(getent passwd "$(id -u)" | cut -d: -f6)"',
|
||||
'if [ -z "$account_home" ]; then',
|
||||
'export HOME="$account_home"',
|
||||
'export USERPROFILE="$account_home"',
|
||||
'export OPENCLAW_STATE_DIR="$account_home/.openclaw"',
|
||||
'export OPENCLAW_CONFIG_PATH="$OPENCLAW_STATE_DIR/openclaw.json"',
|
||||
]);
|
||||
|
||||
expect(
|
||||
runner.indexOf('export OPENCLAW_CONFIG_PATH="$OPENCLAW_STATE_DIR/openclaw.json"'),
|
||||
).toBeLessThan(runner.indexOf("node scripts/e2e/lib/upgrade-survivor/assertions.mjs seed"));
|
||||
});
|
||||
|
||||
it("bounds doctor install switch command log diagnostics", () => {
|
||||
const scenario = readFileSync(DOCTOR_SWITCH_SCENARIO_PATH, "utf8");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user