mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
test(multiplayer): harden agones allocation gate
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user