aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-24 14:45:28 +0200
committerblasty <blasty@local>2026-07-24 14:45:28 +0200
commit720f9e8283257e21ed183d8dff84c7ab6777314d (patch)
treeb2ccbd341949ae9265934274a2d969a7c93e60ea /tests
parentrefactor: extract shared error hierarchy + Session into idatui/errors.py (diff)
downloadida-tui-720f9e8283257e21ed183d8dff84c7ab6777314d.tar.gz
ida-tui-720f9e8283257e21ed183d8dff84c7ab6777314d.tar.xz
ida-tui-720f9e8283257e21ed183d8dff84c7ab6777314d.zip
mcp: collapse app + launcher to worker-only
The idalib worker is now the sole backend for opening a binary, so remove the ida-pro-mcp code paths from the hot path: * app.py: IdaTui.__init__ drops url/db/ensure_server/backend (now just open_path/keepalive/rpc_path/ttl); _connect calls _open_worker_client directly; _open_mcp_client deleted; _reconnect respawns the worker only; self.client and _after_reconnect typed WorkerClient. No more IDAClient import. * launch.py: rewritten worker-only -- validate the binary, sweep stale locks, spawn the TUI (which starts the private worker behind its overlay). The whole supervisor dance (_ensure_server/_start_supervisor/_open_binary/ _existing_session) is gone; `ida-tui foo.elf` is the one usage. * tests/test_scenarios.py: pilot is worker-only (run(binary); binary via positional/--worker/--binary, defaults to targets/echo). Verified: app + launch + pilot import and construct; pilot lists 31 scenarios. The mcp modules (client.py/pane.py/tui.py/spawn.sh) still exist as dead code and are deleted in the next commit. Worker pilot (134/2-known-flakes) still the gate.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_scenarios.py32
1 files changed, 14 insertions, 18 deletions
diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py
index 09335d7..62f474d 100644
--- a/tests/test_scenarios.py
+++ b/tests/test_scenarios.py
@@ -1651,15 +1651,9 @@ async def s_func_banners(c: Ctx):
# --------------------------------------------------------------------------- #
# Runner
# --------------------------------------------------------------------------- #
-async def run(db, only=None, binary=None, backend="mcp"):
- if backend == "worker":
- # Own idalib worker: opens the binary in-process over a unix socket, no
- # supervisor. Mirrors launch.py's worker branch.
- app = IdaTui(url="", db=None, open_path=binary, ensure_server=False,
- backend="worker", keepalive=False)
- else:
- url = os.environ.get("IDA_MCP_URL", "http://127.0.0.1:8745/mcp")
- app = IdaTui(url=url, db=db, keepalive=False)
+async def run(binary, only=None):
+ # Own idalib worker: opens the binary in-process over a unix socket.
+ app = IdaTui(open_path=binary, keepalive=False)
async with app.run_test(size=(140, 44)) as pilot:
c = Ctx(app, pilot)
await c.boot()
@@ -1682,26 +1676,28 @@ async def run(db, only=None, binary=None, backend="mcp"):
def main(argv):
global STOP_AFTER
- db = only = binary = None
- backend = "mcp"
+ only = None
+ binary = None
it = iter(argv)
for a in it:
- if a == "--db":
- db = next(it)
- elif a == "--only":
+ if a == "--only":
only = next(it).split(",")
elif a == "--stop-after":
STOP_AFTER = next(it)
- elif a == "--worker":
- # --worker <binary>: run the suite against our own idalib worker
- backend = "worker"
+ elif a in ("--worker", "--binary"):
binary = os.path.abspath(os.path.expanduser(next(it)))
elif a == "--list":
for name, _ in SCENARIOS:
print(name)
return 0
+ elif not a.startswith("-"):
+ binary = os.path.abspath(os.path.expanduser(a))
+ if binary is None: # default target for the pilot
+ binary = os.path.join(
+ os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
+ "targets", "echo")
try:
- asyncio.run(run(db, only, binary=binary, backend=backend))
+ asyncio.run(run(binary, only))
except _StopSuite:
print(f" … stopped after '{STOP_AFTER}'")
print(f"\n{PASS} passed, {FAIL} failed")