diff options
| author | blasty <peter@haxx.in> | 2026-07-24 14:53:56 +0200 |
|---|---|---|
| committer | blasty <peter@haxx.in> | 2026-07-24 14:53:56 +0200 |
| commit | 3a28b97cb355822b2d380f9507b203b79cb0e4e9 (patch) | |
| tree | 35565378585b06abf03aa772994d9f9e8b3b2f6b /tests/pane_smoke.py | |
| parent | mcp: collapse app + launcher to worker-only (diff) | |
| download | ida-tui-3a28b97cb355822b2d380f9507b203b79cb0e4e9.tar.gz ida-tui-3a28b97cb355822b2d380f9507b203b79cb0e4e9.tar.xz ida-tui-3a28b97cb355822b2d380f9507b203b79cb0e4e9.zip | |
mcp: delete the ida-pro-mcp transport, supervisor, and mcp-only tests
The idalib worker is the only backend now, so remove the dead HTTP/supervisor
surface entirely (~2200 lines):
* deleted idatui/client.py (the IDAClient HTTP/JSON-RPC transport + session
manager), idatui/tui.py (the old mcp TUI entry, superseded by launch.py),
spawn.sh, and systemd/ (the supervisor unit).
* deleted the mcp-only tests (stress_client, smoke_client, test_keepalive,
stress_paging, rpc_smoke, serverctl.sh, pane_smoke, test_domain) -- the worker
pilot (tests/test_scenarios.py) supersedes them.
* migrated the tmux RPC harness (idatui/pane.py) to the worker: it spawns
`idatui.launch <binary> --rpc <sock>` instead of the mcp `idatui.tui`, drops
the supervisor auto-start/ensure machinery, and reaps our own worker
(idatui/worker.py) instead of ida_pro_mcp.idalib_server. --db/--url/--no-
ensure-server are gone; --open is required.
* __init__ / __main__ / domain no longer import client (exceptions come from
errors.py, the domain client hint is WorkerClient); pyproject points both
console scripts at idatui.launch; README + ida-tui header describe the
worker-only flow.
What stays (by design): the ida_pro_mcp *package* (the worker reuses its @tool
functions in-process) and server/patch_server.py (the worker injects its custom
tools on startup). Verified: whole package imports + IdaTui constructs + pilot
lists 31 scenarios. The worker pilot (134 pass / 2 known flakes) is the E2E gate.
Diffstat (limited to 'tests/pane_smoke.py')
| -rw-r--r-- | tests/pane_smoke.py | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/tests/pane_smoke.py b/tests/pane_smoke.py deleted file mode 100644 index bd7def6..0000000 --- a/tests/pane_smoke.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env python3 -"""Smoke test for idatui.pane's supervisor auto-start machinery (no IDA needed). - - python3 tests/pane_smoke.py - -Uses IDATUI_SERVER_CMD to launch a dummy port-binder in a tmux pane instead of -the real ./spawn.sh, so we can exercise _ensure_server end-to-end (start, detect, -idempotency, remote guard) without a real ida-pro-mcp server. Must run in tmux. -""" -import os -import socket -import subprocess -import sys -import tempfile - -sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from idatui import pane # noqa: E402 - -PASS = FAIL = 0 - - -def check(name, cond, detail=""): - global PASS, FAIL - if cond: - PASS += 1 - print(f" ok {name}") - else: - FAIL += 1 - print(f" FAIL {name} {detail}") - - -def _free_port() -> int: - s = socket.socket() - s.bind(("127.0.0.1", 0)) - p = s.getsockname()[1] - s.close() - return p - - -def main() -> int: - if not os.environ.get("TMUX"): - print("error: must run inside tmux", file=sys.stderr) - return 2 - - # a dummy "supervisor": bind the port and idle, so _server_up sees it. - fake = tempfile.NamedTemporaryFile("w", suffix=".py", delete=False) - fake.write( - "import socket,sys,time\n" - "s=socket.socket(); s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)\n" - "s.bind(('127.0.0.1',int(sys.argv[1]))); s.listen(); time.sleep(300)\n") - fake.close() - port = _free_port() - os.environ["IDATUI_SERVER_CMD"] = f"{sys.executable} {fake.name} {port}" - - server_pane = None - try: - check("port starts down", not pane._server_up("127.0.0.1", port)) - - srv = pane._ensure_server("127.0.0.1", port, timeout=15.0) - server_pane = srv.get("server_pane") - check("ensure_server starts the supervisor and it comes up", - srv.get("server_started") and srv.get("server_up") and server_pane, - str(srv)) - check("port is now up", pane._server_up("127.0.0.1", port)) - - srv2 = pane._ensure_server("127.0.0.1", port, timeout=5.0) - check("ensure_server is idempotent when already up", - srv2.get("server_started") is False and srv2.get("server_up") is True, - str(srv2)) - - srv3 = pane._ensure_server("10.255.255.1", 9, timeout=2.0) - check("remote+down server is not auto-started", - srv3.get("server_started") is False and "local" in (srv3.get("error") or ""), - str(srv3)) - finally: - if server_pane: - subprocess.run(["tmux", "kill-pane", "-t", server_pane], - capture_output=True) - os.unlink(fake.name) - os.environ.pop("IDATUI_SERVER_CMD", None) - - print(f"\n{PASS} passed, {FAIL} failed") - return 1 if FAIL else 0 - - -if __name__ == "__main__": - raise SystemExit(main()) |
