Files
mtusi2026lab7/scripts/wait-ready.py
T
Grbisba de4d471d80
Application HTTPS smoke / application (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
Реализация на 5
2026-11-18 11:36:21 +03:00

13 lines
506 B
Python

#!/usr/bin/env python3
import ssl,time,urllib.request,os
from pathlib import Path
root=Path(__file__).resolve().parents[1]
ctx=ssl.create_default_context(cafile=str(root/'secrets/lab7/lb/ca.crt'))
for _ in range(90):
try:
with urllib.request.urlopen(os.environ.get('LAB7_BASE_URL','https://localhost:8443')+'/health/ready',context=ctx,timeout=2) as r:
if r.status==200:print('PASS: verified HTTPS readiness');break
except OSError:pass
time.sleep(1)
else:raise SystemExit('HTTPS readiness timeout')