fix(e2e): apply default service identity per flow (#116265)

This commit is contained in:
Peter Steinberger
2026-07-30 00:00:14 -07:00
committed by GitHub
parent e4e7f37d24
commit 3e67671d92
2 changed files with 15 additions and 12 deletions

View File

@@ -60,7 +60,7 @@ update_doctor_env+=" OPENCLAW_UPDATE_PARENT_SUPPORTS_GATEWAY_RESTART=1"
update_doctor_env+=" OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_SERVICE_REPAIR=1"
update_doctor_env+=" OPENCLAW_UPDATE_PARENT_ALLOWS_GATEWAY_ACTIVATION=0"
create_default_service_state() {
use_default_service_identity() {
local account_home
account_home="$(node -p 'require("node:os").userInfo().homedir')"
@@ -73,7 +73,6 @@ create_default_service_state() {
"$account_home/.config/powershell" \
"$account_home/.local/bin/openclaw-wrapper" \
"$account_home/openclaw-wrapper-argv.log"
openclaw_test_state_create "$account_home" empty
export HOME="$account_home"
export USERPROFILE="$account_home"
unset OPENCLAW_HOME OPENCLAW_STATE_DIR OPENCLAW_CONFIG_PATH
@@ -158,7 +157,8 @@ run_flow() {
local command_timeout="${OPENCLAW_DOCKER_DOCTOR_SWITCH_COMMAND_TIMEOUT:-900s}"
echo "== Flow: $name =="
create_default_service_state
openclaw_test_state_create "switch-${name}" empty
use_default_service_identity
export USER="testuser"
if ! openclaw_e2e_maybe_timeout "$command_timeout" bash -c "$install_cmd" >"$install_log" 2>&1; then
@@ -282,7 +282,8 @@ run_proxy_env_flow() {
local command_timeout="${OPENCLAW_DOCKER_DOCTOR_SWITCH_COMMAND_TIMEOUT:-900s}"
echo "== Flow: $name =="
create_default_service_state
openclaw_test_state_create "switch-${name}" empty
use_default_service_identity
export USER="testuser"
unit_path="$HOME/.config/systemd/user/openclaw-gateway.service"
@@ -328,7 +329,8 @@ run_wrapper_flow() {
local command_timeout="${OPENCLAW_DOCKER_DOCTOR_SWITCH_COMMAND_TIMEOUT:-900s}"
echo "== Flow: $name =="
create_default_service_state
openclaw_test_state_create "switch-${name}" empty
use_default_service_identity
export USER="testuser"
mkdir -p "$HOME/.local/bin"
local wrapper="$HOME/.local/bin/openclaw-wrapper"