test(multiplayer): harden agones allocation gate

This commit is contained in:
Josh Creek
2026-09-01 18:16:54 +01:00
parent e3fad7064b
commit 7c044b7094
7 changed files with 133 additions and 15 deletions
+1 -13
View File
@@ -99,16 +99,4 @@ spec:
EOF
kubectl create -f "$work_dir/allocation.yaml" -o json > "$work_dir/allocation.json"
python3 - "$work_dir/allocation.json" <<'PY'
import json
import sys
doc = json.load(open(sys.argv[1], encoding="utf-8"))
status = doc.get("status", {})
if status.get("state") != "Allocated":
raise SystemExit(f"allocation state is {status.get('state')!r}, expected 'Allocated'")
ports = status.get("gameServer", {}).get("status", {}).get("ports", [])
if not ports or not any(p.get("port", 0) > 0 and p.get("port") != 7777 for p in ports):
raise SystemExit(f"allocation did not return a dynamic UDP port: {ports!r}")
print("8.49 PASS: Fleet became ready and allocation returned a dynamic UDP port")
PY
python3 scripts/verify_agones_allocation_response.py "$work_dir/allocation.json"