aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-24 14:24:05 +0200
committerblasty <blasty@local>2026-07-24 14:24:05 +0200
commitc4bf286e419b24b2317f250884c3235dedb1c53c (patch)
tree245e7b7e711f1573831b8de90e38a7e1f23bfa44 /tests
parentworker: inject custom tools on startup (self-sufficient, no spawn.sh needed) (diff)
downloadida-tui-c4bf286e419b24b2317f250884c3235dedb1c53c.tar.gz
ida-tui-c4bf286e419b24b2317f250884c3235dedb1c53c.tar.xz
ida-tui-c4bf286e419b24b2317f250884c3235dedb1c53c.zip
tests: add --worker <binary> to run the pilot suite against the idalib worker
run()/main() gain a worker path: IdaTui(open_path=binary, backend="worker", ensure_server=False) instead of attaching to an mcp supervisor via --db. boot() and every scenario are backend-agnostic (they drive app.program), so the full 31-scenario suite runs unchanged on the worker. This is the verification gate before deleting the mcp transport: ~/ida-venv/bin/python tests/test_scenarios.py --worker targets/echo The default (no --worker) still uses the mcp supervisor + --db, so nothing regresses until we pull the plug.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_scenarios.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py
index 7372c02..eed3c59 100644
--- a/tests/test_scenarios.py
+++ b/tests/test_scenarios.py
@@ -1651,9 +1651,15 @@ async def s_func_banners(c: Ctx):
# --------------------------------------------------------------------------- #
# Runner
# --------------------------------------------------------------------------- #
-async def run(db, only=None):
- 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(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(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 with app.run_test(size=(140, 44)) as pilot:
c = Ctx(app, pilot)
await c.boot()
@@ -1676,7 +1682,8 @@ async def run(db, only=None):
def main(argv):
global STOP_AFTER
- db = only = None
+ db = only = binary = None
+ backend = "mcp"
it = iter(argv)
for a in it:
if a == "--db":
@@ -1685,12 +1692,16 @@ def main(argv):
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"
+ binary = os.path.abspath(os.path.expanduser(next(it)))
elif a == "--list":
for name, _ in SCENARIOS:
print(name)
return 0
try:
- asyncio.run(run(db, only))
+ asyncio.run(run(db, only, binary=binary, backend=backend))
except _StopSuite:
print(f" … stopped after '{STOP_AFTER}'")
print(f"\n{PASS} passed, {FAIL} failed")