fix(deploy): test-api.sh — skip capture 404 (sidecar/idle mode is normal)
This commit is contained in:
parent
5161644205
commit
28a97e2ba3
1 changed files with 29 additions and 25 deletions
|
|
@ -132,7 +132,6 @@ check_post "POST /cluster/heartbeat" "/api/v1/cluster/heartbeat" \
|
|||
"{\"hostname\":\"$TEST_HOST\",\"role\":\"smoketest\",\"cpu_usage\":0,\"mem_used_mb\":512,\"mem_total_mb\":4096}" \
|
||||
200
|
||||
|
||||
# Find the node we just registered (grab first UUID from array)
|
||||
NODE_ID=$(curl -s "${AUTH_ARGS[@]}" "$BASE/api/v1/cluster" 2>/dev/null \
|
||||
| grep -o '"id":"[^"]*"' | head -1 | grep -o '[0-9a-f-]\{36\}' || true)
|
||||
|
||||
|
|
@ -151,16 +150,21 @@ header "System"
|
|||
check_status "GET /system/containers" "/api/v1/system/containers" 200
|
||||
check_body "Containers returns array" "/api/v1/system/containers" '['
|
||||
|
||||
# ── Capture (proxies to capture service — 500 if container is down) ───────────
|
||||
# ── Capture (proxies to capture service) ─────────────────────────────────────
|
||||
header "Capture"
|
||||
# 200 = capture active and responding
|
||||
# 404 = capture in sidecar/idle mode (no active recorder — expected in dev)
|
||||
# 5xx = capture container unreachable
|
||||
CAPTURE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "${AUTH_ARGS[@]}" \
|
||||
"$BASE/api/v1/capture/status" 2>/dev/null)
|
||||
if [[ "$CAPTURE_CODE" == "200" ]]; then
|
||||
pass "GET /capture/status [HTTP 200]"
|
||||
pass "GET /capture/status [HTTP 200 — capture active]"
|
||||
elif [[ "$CAPTURE_CODE" == "404" ]]; then
|
||||
skip "GET /capture/status [HTTP 404]" "capture in idle/sidecar mode (normal when not recording)"
|
||||
elif [[ "$CAPTURE_CODE" =~ ^5 ]]; then
|
||||
skip "GET /capture/status [HTTP $CAPTURE_CODE]" "capture service proxy error (container down?)"
|
||||
skip "GET /capture/status [HTTP $CAPTURE_CODE]" "capture container unreachable"
|
||||
else
|
||||
fail "GET /capture/status [HTTP $CAPTURE_CODE]" "expected 200 or 5xx"
|
||||
fail "GET /capture/status [HTTP $CAPTURE_CODE]" "unexpected status"
|
||||
fi
|
||||
|
||||
# ── Users / Tokens ───────────────────────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Reference in a new issue