forked from wangziqi/ruoyi-vue-pro
feat(education): establish operational independence contracts
This commit is contained in:
25
tools/education-target-smoke/java-read-readiness.sh
Executable file
25
tools/education-target-smoke/java-read-readiness.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
BASE_URL="${BASE_URL:-http://127.0.0.1:48080}"
|
||||
TOKEN="${EDUCATION_ADMIN_TOKEN:?EDUCATION_ADMIN_TOKEN is required}"
|
||||
TENANT_ID="${EDUCATION_TENANT_ID:?EDUCATION_TENANT_ID is required}"
|
||||
|
||||
response="$(curl --fail --silent --show-error \
|
||||
-H "Authorization: Bearer ${TOKEN}" \
|
||||
-H "tenant-id: ${TENANT_ID}" \
|
||||
"${BASE_URL}/admin-api/education/operations/health")"
|
||||
|
||||
python3 - "$response" <<'PY'
|
||||
import json, sys
|
||||
body = json.loads(sys.argv[1])
|
||||
assert body.get("code") == 0, body
|
||||
health = body["data"]
|
||||
deps = {item["key"]: item for item in health["dependencies"]}
|
||||
java = deps.get("java-read-postgresql")
|
||||
scalar = deps.get("scalar-catalog")
|
||||
assert java and java["required"] and java["status"] == "UP", deps
|
||||
assert scalar and not scalar["required"] and scalar["status"] == "NOT_SELECTED", deps
|
||||
assert health["status"] in ("UP", "DEGRADED"), health
|
||||
print("target-only JAVA_READ readiness proof passed")
|
||||
PY
|
||||
Reference in New Issue
Block a user