File: //proc/self/root/workspace/rollout/verify-mission-control-fix.sh
#!/usr/bin/env bash
set -euo pipefail
BASE_URL=${BASE_URL:-https://altaira.panomity.com/mc}
AUTH_TOKEN=${AUTH_TOKEN:-ztbHKAe1UYI66HCFvSAyo4wrAAD6frNCyAZ67aKVeSE}
BOARD_ID=${BOARD_ID:-2857b7e4-abd0-41ae-8185-4bc3c37cfee1}
check() {
local label=$1
local url=$2
local want=${3:-200}
local auth=${4:-bearer}
local hdr=()
if [[ $auth == bearer ]]; then
hdr=(-H "Authorization: Bearer $AUTH_TOKEN")
fi
local code
code=$(curl -sS -o /tmp/mcverify.body -D /tmp/mcverify.headers -w '%{http_code}' "${hdr[@]}" "$url")
printf '%-12s %s\n' "$label" "$code"
sed -n '1,8p' /tmp/mcverify.headers | sed 's/^/ /'
head -c 220 /tmp/mcverify.body | tr '\n' ' '; echo
echo
[[ "$code" == "$want" ]]
}
fail=0
check healthz "$BASE_URL/healthz" 200 bearer || fail=1
check boards "$BASE_URL/api/v1/agent/boards" 200 bearer || fail=1
check tasks "$BASE_URL/api/v1/agent/boards/$BOARD_ID/tasks" 200 bearer || fail=1
check openapi "$BASE_URL/openapi.json" 200 none || fail=1
if [[ $fail -ne 0 ]]; then
echo 'Verification failed.' >&2
exit 1
fi
echo 'Verification passed.'