forked from mtusi2026/mtusi2026lab7
test(security): automate lifecycle and login budget measurements
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user