diff options
| author | Duncan Ogilvie <mr.exodia.tpodt@gmail.com> | 2026-08-20 23:55:52 +0200 |
|---|---|---|
| committer | Duncan Ogilvie <mr.exodia.tpodt@gmail.com> | 2026-08-20 23:55:52 +0200 |
| commit | f4c1d9b5497fd0d38137b6b345e8171b307c1117 (patch) | |
| tree | 5f1f9b0d27c2894582512727c2a3f002077f4097 /tests | |
| parent | Adopt idb_events and remote module features from ida-codemode (diff) | |
| download | ida-tui-f4c1d9b5497fd0d38137b6b345e8171b307c1117.tar.gz ida-tui-f4c1d9b5497fd0d38137b6b345e8171b307c1117.tar.xz ida-tui-f4c1d9b5497fd0d38137b6b345e8171b307c1117.zip | |
Switch to ida-nexus
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/_fixtures.py | 2 | ||||
| -rwxr-xr-x | tests/run.py | 4 | ||||
| -rw-r--r-- | tests/test_kittygfx.py | 2 | ||||
| -rw-r--r-- | tests/test_launch.py | 6 | ||||
| -rw-r--r-- | tests/test_nexus_client.py (renamed from tests/test_codemode_client.py) | 30 | ||||
| -rw-r--r-- | tests/test_pool.py | 4 | ||||
| -rw-r--r-- | tests/test_project.py | 2 | ||||
| -rw-r--r-- | tests/test_scenarios.py | 2 | ||||
| -rw-r--r-- | tests/test_thumb_ui.py | 2 | ||||
| -rw-r--r-- | tests/test_trace_ui.py | 2 |
10 files changed, 28 insertions, 28 deletions
diff --git a/tests/_fixtures.py b/tests/_fixtures.py index 16192fa..bc10235 100644 --- a/tests/_fixtures.py +++ b/tests/_fixtures.py @@ -133,7 +133,7 @@ async def build_pristine(binary: str, cache: str, app_factory) -> None: break app.program.client.save_database() # Textual's headless run_test context does not reliably emit App.Unmount on - # every platform/version; release the Code Mode lease explicitly. + # every platform/version; release the IDA Nexus lease explicitly. if app.program is not None: app.program.close() if app.client is not None: diff --git a/tests/run.py b/tests/run.py index b38a707..5d552bb 100755 --- a/tests/run.py +++ b/tests/run.py @@ -51,8 +51,8 @@ import time ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TESTS = os.path.join(ROOT, "tests") -#: The IDA-capable interpreter. The pilot tests need textual AND the Code Mode -#: library in one python; the database process is Code Mode's to place. +#: The IDA-capable interpreter. The pilot tests need textual AND the IDA Nexus +#: library in one python; the database process is IDA Nexus's to place. DEFAULT_PY = os.path.expanduser("~/ida-venv/bin/python") #: Both shapes the suites print: "N passed, M failed" and "N checks, M failed". diff --git a/tests/test_kittygfx.py b/tests/test_kittygfx.py index 74b6bb7..cfc6512 100644 --- a/tests/test_kittygfx.py +++ b/tests/test_kittygfx.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """Cross-platform checks for the optional kitty-graphics startup splash. -Pure: stdlib only, no terminal, Textual, Code Mode, or IDA. +Pure: stdlib only, no terminal, Textual, IDA Nexus, or IDA. """ from __future__ import annotations diff --git a/tests/test_launch.py b/tests/test_launch.py index d57ee5f..35a0b8d 100644 --- a/tests/test_launch.py +++ b/tests/test_launch.py @@ -3,12 +3,12 @@ The old `_sweep_locks` deleted `.id0/.id1/.id2/.nam/.til` next to the user's binary when a database failed to open. That was only defensible while the TUI -exclusively owned a private worker; under Code Mode a GUI or another client may +exclusively owned a private worker; under IDA Nexus a GUI or another client may own the database, so the sweep is gone. Its tests are replaced by one that keeps it gone -- deleting a shared database's working files is unrecoverable, and this is the cheapest guard against someone reintroducing the "helpful" cleanup. -Pure: no IDA, no Code Mode library, no Textual. +Pure: no IDA, no IDA Nexus library, no Textual. """ from __future__ import annotations @@ -47,7 +47,7 @@ def touch(*paths): def t_no_lock_sweeping(): """The launcher must not delete database working files any more. - Code Mode's registry locks, health probes and IDA itself arbitrate database + IDA Nexus's registry locks, health probes and IDA itself arbitrate database ownership now. A sweep here would delete files out from under a live GUI. """ check("_sweep_locks is gone", not hasattr(launch, "_sweep_locks")) diff --git a/tests/test_codemode_client.py b/tests/test_nexus_client.py index dd0ae08..4ebf753 100644 --- a/tests/test_codemode_client.py +++ b/tests/test_nexus_client.py @@ -1,4 +1,4 @@ -"""IDA-free contract tests for the Code Mode client adapter.""" +"""IDA-free contract tests for the IDA Nexus client adapter.""" from __future__ import annotations @@ -13,10 +13,10 @@ from dataclasses import dataclass sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from idatui.errors import IDAConnectionError, IDAToolError # noqa: E402 from idatui import remote_ops # noqa: E402 -import idatui.codemode_client as module # noqa: E402 -from idatui.codemode_client import CodeModeClient, _parse_load_args # noqa: E402 +import idatui.nexus_client as module # noqa: E402 +from idatui.nexus_client import NexusClient, _parse_load_args # noqa: E402 -#: Pure: fakes the DatabaseHandle, never touches IDA or the Code Mode library. +#: Pure: fakes the DatabaseHandle, never touches IDA or the IDA Nexus library. NEEDS_IDA = False PASS = FAIL = 0 @@ -180,13 +180,13 @@ class FakeDisconnected(Exception): def _open_kwargs_are_real(sent: dict): """(ok, detail) for the kwargs the adapter passes to DatabaseHandle.open. - Skips (passes) when ida_codemode is not installed, so the file stays pure. + Skips (passes) when ida_nexus is not installed, so the file stays pure. """ try: import inspect - from ida_codemode import DatabaseHandle as Real + from ida_nexus import DatabaseHandle as Real except ImportError: - return True, "ida_codemode not installed - signature not checked" + return True, "ida_nexus not installed - signature not checked" accepted = set(inspect.signature(Real.open).parameters) unknown = sorted(set(sent) - accepted) return not unknown, f"open() rejects {unknown}" @@ -201,9 +201,9 @@ def _option_fields_are_real(options): """ try: import dataclasses - from ida_codemode import DatabaseOpenOptions as Real + from ida_nexus import DatabaseOpenOptions as Real except ImportError: - return True, "ida_codemode not installed - fields not checked" + return True, "ida_nexus not installed - fields not checked" accepted = {field.name for field in dataclasses.fields(Real)} unknown = sorted({f.name for f in dataclasses.fields(options)} - accepted) return not unknown, f"DatabaseOpenOptions rejects {unknown}" @@ -212,7 +212,7 @@ def _option_fields_are_real(options): def main() -> int: proc, base, file_type = _parse_load_args("-parm:ARMv7-M -b800000 -TRaw") check( - "legacy switches map to typed Code Mode options", + "legacy switches map to typed IDA Nexus options", (proc, base, file_type) == ("arm:ARMv7-M", 0x8000000, "Raw"), (proc, base, file_type), ) @@ -238,7 +238,7 @@ def main() -> int: path = os.path.join(tmp, "sample.bin") with open(path, "wb") as file: file.write(b"sample") - client = CodeModeClient(path, load_args="-parm:ARMv7-A -b100") + client = NexusClient(path, load_args="-parm:ARMv7-A -b100") notes = [] client.connect(timeout=42, progress=notes.append) handle = client._handle @@ -266,7 +266,7 @@ def main() -> int: *_open_kwargs_are_real(FakeDatabaseHandle.kwargs), ) check( - "connect waits for Code Mode autoanalysis", + "connect waits for IDA Nexus autoanalysis", handle.waited == 42, getattr(handle, "waited", None), ) @@ -337,7 +337,7 @@ def main() -> int: client.health()["record_id"] == "123-abcdef", ) client.save_database() - check("save uses the public Code Mode save route", handle.saved == 1) + check("save uses the public IDA Nexus save route", handle.saved == 1) check( "GUI leases transfer rather than claiming discard", client.discard_database() is False and handle.shutdown_calls == [], @@ -389,7 +389,7 @@ def main() -> int: "GUI lifetime is never claimed by the client", client.wait_released(0) is False, ) - disconnected = CodeModeClient(path).connect() + disconnected = NexusClient(path).connect() stream_errors = [] stream_failed = threading.Event() @@ -417,7 +417,7 @@ def main() -> int: module.DatabaseBusyError = original_busy module.DatabaseDisconnectedError = original_disconnected - client = CodeModeClient(__file__) + client = NexusClient(__file__) def unknown_operation(): pass diff --git a/tests/test_pool.py b/tests/test_pool.py index 6309e13..37058bf 100644 --- a/tests/test_pool.py +++ b/tests/test_pool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -"""Unit tests for idatui.pool (Code Mode lease residency and LRU budget). +"""Unit tests for idatui.pool (IDA Nexus lease residency and LRU budget). A fake client keeps the policy testable without IDA or Textual. @@ -31,7 +31,7 @@ def check(name, cond, detail=""): class FakeClient: - """Stands in for a CodeModeClient lease and records saves/closes.""" + """Stands in for a NexusClient lease and records saves/closes.""" def __init__(self, ref, mem=100, backend="idalib", discardable=True): diff --git a/tests/test_project.py b/tests/test_project.py index 690f360..bae0802 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """Unit tests for idatui.project (the multi-binary project model + staging). -IDA-free: exercises staging plus Code Mode ownership checks without opening a database. +IDA-free: exercises staging plus IDA Nexus ownership checks without opening a database. python tests/test_project.py """ diff --git a/tests/test_scenarios.py b/tests/test_scenarios.py index 45ed51b..190777c 100644 --- a/tests/test_scenarios.py +++ b/tests/test_scenarios.py @@ -5272,7 +5272,7 @@ async def run(binary, only=None): async def _run_on(binary, only=None): - # Code Mode attaches a registered GUI or starts/reuses a managed worker. + # IDA Nexus attaches a registered GUI or starts/reuses a managed worker. app = IdaTui(open_path=binary, keepalive=False) async with app.run_test(size=(140, 44)) as pilot: c = Ctx(app, pilot) diff --git a/tests/test_thumb_ui.py b/tests/test_thumb_ui.py index f12fbc4..1b4c438 100644 --- a/tests/test_thumb_ui.py +++ b/tests/test_thumb_ui.py @@ -50,7 +50,7 @@ def check(name, ok, detail=""): #: #: This suite used to delete <BIN>.i64 and reopen the SAME path for each phase. #: That was safe when the TUI owned a private worker that died with it; under -#: Code Mode the database is leased and the previous phase's worker can still +#: IDA Nexus the database is leased and the previous phase's worker can still #: hold it through its lease grace, so the delete raced a live owner and the #: next open never produced a listing (the crash this fixed). Separate paths #: cannot collide, and nothing has to wait for anyone else to let go. diff --git a/tests/test_trace_ui.py b/tests/test_trace_ui.py index 855ce4d..586ce2e 100644 --- a/tests/test_trace_ui.py +++ b/tests/test_trace_ui.py @@ -115,7 +115,7 @@ async def run() -> int: # `app._t` is assigned the moment the key is handled, so it is NOT a # signal that the VIEW has followed -- the navigation it kicks off # runs in a worker. Waiting on it and then reading the cursor was a - # race that the (slower) Code Mode backend loses. Gate on the thing + # race that the (slower) IDA Nexus backend loses. Gate on the thing # the check is about. await settle(app, lambda: app._t == 1 and lst._cursor_ea() == t.ip(1), timeout=20) |
