test(security): automate lifecycle and login budget measurements

This commit is contained in:
2026-11-20 19:19:20 +03:00
parent f2ea9d65a8
commit d6957b2f79
11 changed files with 1020 additions and 301 deletions
+13 -2
View File
@@ -15,6 +15,7 @@ import httpx
from scripts import cluster
from scripts.stand import BASE, ROOT, actor, auth, command, compose, ready, sql
from scripts.tls_client import FreshTrustTransport
def snapshot():
@@ -148,7 +149,12 @@ def main():
apis = [c for c in initial if c["role"] == "api"]
assert len(apis) == 2 and len({c["pid"] for c in apis}) == 2
report["before"] = initial
with httpx.Client(base_url=BASE, trust_env=False, timeout=8) as client:
with httpx.Client(
base_url=BASE,
trust_env=False,
timeout=8,
transport=FreshTrustTransport(),
) as client:
user, _, session = actor(client)
r = client.post(
"/api/v1/chats",
@@ -165,7 +171,10 @@ def main():
def repeat(_):
with httpx.Client(
base_url=BASE, trust_env=False, timeout=8
base_url=BASE,
trust_env=False,
timeout=8,
transport=FreshTrustTransport(),
) as c:
r = c.post(
path,
@@ -321,6 +330,8 @@ def main():
hook,
"--base-url",
BASE,
"--ca-file",
str(ROOT / "trust/ca.pem"),
],
cwd=ROOT,
env=env,