test: harden Docker install e2e agent lane

This commit is contained in:
Peter Steinberger
2026-04-08 06:57:35 +01:00
parent 3b1c6d3266
commit 0a5aefefbd
2 changed files with 9 additions and 7 deletions

View File

@@ -451,6 +451,7 @@ run_profile() {
local image_model
if [[ "$agent_model_provider" == "openai" ]]; then
agent_model="$(set_agent_model "$profile" \
"openai/gpt-5.4" \
"openai/gpt-4.1-mini" \
"openai/gpt-4.1" \
"openai/gpt-4o-mini" \
@@ -483,7 +484,7 @@ run_profile() {
PROOF_VALUE="$(node -e 'console.log(require("node:crypto").randomBytes(16).toString("hex"))')"
echo -n "$PROOF_VALUE" >"$PROOF_TXT"
write_png_lr_rg "$IMAGE_PNG"
EXPECTED_HOSTNAME="$(cat /etc/hostname | tr -d '\r\n')"
EXPECTED_HOSTNAME="$(hostname | tr -d '\r\n')"
echo "==> Start gateway ($profile)"
GATEWAY_LOG="$workspace/gateway.log"
@@ -498,13 +499,13 @@ run_profile() {
trap cleanup_profile EXIT
echo "==> Wait for health ($profile)"
for _ in $(seq 1 60); do
if openclaw --profile "$profile" health --timeout 2000 --json >/dev/null 2>&1; then
for _ in $(seq 1 240); do
if openclaw --profile "$profile" health --timeout 5000 --json >/dev/null 2>&1; then
break
fi
sleep 0.25
done
openclaw --profile "$profile" health --timeout 10000 --json >/dev/null
openclaw --profile "$profile" health --timeout 60000 --json >/dev/null
echo "==> Agent turns ($profile)"
TURN1_JSON="/tmp/agent-${profile}-1.json"
@@ -550,14 +551,14 @@ run_profile() {
fi
run_agent_turn "$profile" "$SESSION_ID" \
"Use the exec tool to run: cat /etc/hostname. Reply with the exact stdout only (trim trailing newline)." \
"Use the exec tool to run this command: hostname. Reply with the exact stdout only (trim trailing newline)." \
"$TURN3_JSON"
assert_agent_json_has_text "$TURN3_JSON"
assert_agent_json_ok "$TURN3_JSON" "$agent_model_provider"
local reply3
reply3="$(extract_matching_text "$TURN3_JSON" "$EXPECTED_HOSTNAME" | tr -d '\r\n')"
if [[ "$reply3" != "$EXPECTED_HOSTNAME" ]]; then
echo "ERROR: agent did not read /etc/hostname correctly ($profile): $reply3" >&2
echo "ERROR: agent did not run hostname correctly ($profile): $reply3" >&2
exit 1
fi
local prompt3b
@@ -566,7 +567,7 @@ run_profile() {
assert_agent_json_has_text "$TURN3B_JSON"
assert_agent_json_ok "$TURN3B_JSON" "$agent_model_provider"
if [[ "$(cat "$HOSTNAME_TXT" 2>/dev/null | tr -d '\r\n' || true)" != "$EXPECTED_HOSTNAME" ]]; then
echo "ERROR: hostname.txt did not match /etc/hostname ($profile)" >&2
echo "ERROR: hostname.txt did not match hostname output ($profile)" >&2
exit 1
fi

View File

@@ -23,6 +23,7 @@ docker run --rm \
-e OPENCLAW_E2E_MODELS="$OPENCLAW_E2E_MODELS" \
-e OPENCLAW_INSTALL_E2E_PREVIOUS="${OPENCLAW_INSTALL_E2E_PREVIOUS:-}" \
-e OPENCLAW_INSTALL_E2E_SKIP_PREVIOUS="${OPENCLAW_INSTALL_E2E_SKIP_PREVIOUS:-0}" \
-e OPENCLAW_NO_ONBOARD=1 \
-e OPENAI_API_KEY="$OPENAI_API_KEY" \
-e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
-e ANTHROPIC_API_TOKEN="$ANTHROPIC_API_TOKEN" \