kink-discovery / tests /test_adversarial_partner_probes_script.py
Perplexed7675's picture
Sync from kink_cli (Docker Space)
6ff91d6 verified
Raw
History Blame Contribute Delete
882 Bytes
"""Run scripts/adversarial_partner_probes.py with KINK_PROBE_HTTP=1 (CI covers HTTP layer)."""
from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parent.parent
SCRIPT = ROOT / "scripts" / "adversarial_partner_probes.py"
def test_adversarial_partner_probes_with_http_layer() -> None:
assert SCRIPT.is_file(), SCRIPT
env = {
**os.environ,
"KINK_PROBE_HTTP": "1",
"KINK_SKIP_HEAVY_WARM": "1",
}
proc = subprocess.run(
[sys.executable, str(SCRIPT)],
cwd=str(ROOT),
env=env,
capture_output=True,
text=True,
timeout=120,
)
if proc.returncode != 0:
pytest.fail(
f"adversarial_partner_probes exit {proc.returncode}\nstdout:\n{proc.stdout}\nstderr:\n{proc.stderr}",
)