Verify independent clean-clone PKI bootstrap, full store restart and persistent Grafana provisioning

This commit is contained in:
2026-12-02 17:32:59 +03:00
parent 047cef4c7f
commit f460620d49
5 changed files with 726 additions and 26 deletions
-16
View File
@@ -1,16 +0,0 @@
#!/usr/bin/env python3
"""Prove the SLI also observes a 503 generated by HAProxy, outside API SDKs."""
import json,time,urllib.request,urllib.error
from observability import ROOT,BASE,Client,check,dc,scalar,wait_for
c=Client(BASE);a,b,e,chat=c.bootstrap();before=scalar('sum(haproxy_backend_http_responses_total{proxy="replicas",code="5xx"})') or 0
try:
dc('stop','api');time.sleep(2)
req=urllib.request.Request(BASE+'/api/v1/users/me',headers={'Authorization':'Bearer '+a['token']})
try:response=urllib.request.urlopen(req,timeout=4)
except urllib.error.HTTPError as error:response=error
with response:check(response.code==503,'expected LB 503');status=response.code
after,delay=wait_for(lambda: (lambda n:n if n is not None and n>before else None)(scalar('sum(haproxy_backend_http_responses_total{proxy="replicas",code="5xx"})')),15)
result={'client_status':status,'api_processes_stopped':True,'ingress_5xx_before':before,'ingress_5xx_after':after,'observation_seconds':delay,'lb_generated_error_counted':True}
(ROOT/'evidence/ingress-guard.json').write_text(json.dumps(result,indent=2)+'\n');print('PASS: LB-generated 503 included in business ingress SLI')
finally:dc('up','-d','--no-deps','--wait','api')
c.call('GET','/api/v1/users/me',actor=a,schema='User')