mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:40:44 +00:00
test: stabilize parallels npm update smoke
This commit is contained in:
@@ -58,33 +58,49 @@ parallels_macos_desktop_user_exec_with_secret_file() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local wrapper
|
local wrapper
|
||||||
wrapper='
|
local wrapper_path
|
||||||
|
wrapper_path="/tmp/openclaw-secret-env-wrapper-$RANDOM-$RANDOM.sh"
|
||||||
|
wrapper='#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
cleanup() {
|
||||||
|
rm -f "${OPENCLAW_WRAPPER_FILE:-}"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
if [ -n "${OPENCLAW_SECRET_ENV_NAME:-}" ] && [ -n "${OPENCLAW_SECRET_FILE:-}" ] && [ -f "$OPENCLAW_SECRET_FILE" ]; then
|
if [ -n "${OPENCLAW_SECRET_ENV_NAME:-}" ] && [ -n "${OPENCLAW_SECRET_FILE:-}" ] && [ -f "$OPENCLAW_SECRET_FILE" ]; then
|
||||||
secret_value="$(cat "$OPENCLAW_SECRET_FILE")"
|
secret_value="$(cat "$OPENCLAW_SECRET_FILE")"
|
||||||
rm -f "$OPENCLAW_SECRET_FILE"
|
rm -f "$OPENCLAW_SECRET_FILE"
|
||||||
export "${OPENCLAW_SECRET_ENV_NAME}=${secret_value}"
|
export "${OPENCLAW_SECRET_ENV_NAME}=${secret_value}"
|
||||||
fi
|
fi
|
||||||
exec "$@"
|
"$@"
|
||||||
'
|
'
|
||||||
|
|
||||||
|
if [[ "$user_flag" == "current-user" ]]; then
|
||||||
|
printf '%s' "$wrapper" | /usr/bin/base64 | prlctl exec "$vm_name" \
|
||||||
|
--current-user /usr/bin/base64 -D -o "$wrapper_path"
|
||||||
|
else
|
||||||
|
printf '%s' "$wrapper" | /usr/bin/base64 | prlctl exec "$vm_name" \
|
||||||
|
/usr/bin/sudo -H -u "$user_name" /usr/bin/base64 -D -o "$wrapper_path"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$user_flag" == "current-user" ]]; then
|
if [[ "$user_flag" == "current-user" ]]; then
|
||||||
prlctl exec "$vm_name" --current-user /usr/bin/env \
|
prlctl exec "$vm_name" --current-user /usr/bin/env \
|
||||||
"PATH=$path_value" \
|
"PATH=$path_value" \
|
||||||
"OPENCLAW_SECRET_ENV_NAME=$api_key_env" \
|
"OPENCLAW_SECRET_ENV_NAME=$api_key_env" \
|
||||||
"OPENCLAW_SECRET_FILE=$secret_path" \
|
"OPENCLAW_SECRET_FILE=$secret_path" \
|
||||||
/bin/bash -c "$wrapper" openclaw-secret-env "$@"
|
"OPENCLAW_WRAPPER_FILE=$wrapper_path" \
|
||||||
|
/bin/bash "$wrapper_path" "$@"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
prlctl exec "$vm_name" /usr/bin/sudo -u "$user_name" /usr/bin/env \
|
prlctl exec "$vm_name" /usr/bin/sudo -H -u "$user_name" /usr/bin/env \
|
||||||
"HOME=$home" \
|
"HOME=$home" \
|
||||||
"USER=$user_name" \
|
"USER=$user_name" \
|
||||||
"LOGNAME=$user_name" \
|
"LOGNAME=$user_name" \
|
||||||
"PATH=$path_value" \
|
"PATH=$path_value" \
|
||||||
"OPENCLAW_SECRET_ENV_NAME=$api_key_env" \
|
"OPENCLAW_SECRET_ENV_NAME=$api_key_env" \
|
||||||
"OPENCLAW_SECRET_FILE=$secret_path" \
|
"OPENCLAW_SECRET_FILE=$secret_path" \
|
||||||
/bin/bash -c "$wrapper" openclaw-secret-env "$@"
|
"OPENCLAW_WRAPPER_FILE=$wrapper_path" \
|
||||||
|
/bin/bash "$wrapper_path" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
parallels_macos_desktop_user_exec() {
|
parallels_macos_desktop_user_exec() {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ UPDATE_EXPECTED_NEEDLE=""
|
|||||||
API_KEY_VALUE=""
|
API_KEY_VALUE=""
|
||||||
PROGRESS_INTERVAL_S=15
|
PROGRESS_INTERVAL_S=15
|
||||||
PROGRESS_STALE_S=60
|
PROGRESS_STALE_S=60
|
||||||
TIMEOUT_UPDATE_S=300
|
TIMEOUT_UPDATE_S="${OPENCLAW_PARALLELS_NPM_UPDATE_TIMEOUT_S:-900}"
|
||||||
TIMEOUT_UPDATE_POLL_GRACE_S=60
|
TIMEOUT_UPDATE_POLL_GRACE_S=60
|
||||||
|
|
||||||
child_job_running() {
|
child_job_running() {
|
||||||
|
|||||||
Reference in New Issue
Block a user