From 05797fd8cf884bb680540dfc188f36836a215c9f Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Fri, 2 Oct 2026 11:44:31 -0400 Subject: rename (cosmetic): green-eye -> risc-v-gsp-rm-debugger in user-facing names, docs, CLI, launcher and CI workflow; internal greeneye package/module identifiers unchanged (includes in-flight greeneye module edits present in the tree) --- debug/risc-v-gsp-rm-vm/tests/test_version_diff.py | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'debug/risc-v-gsp-rm-vm/tests/test_version_diff.py') diff --git a/debug/risc-v-gsp-rm-vm/tests/test_version_diff.py b/debug/risc-v-gsp-rm-vm/tests/test_version_diff.py index df704df..d20e780 100644 --- a/debug/risc-v-gsp-rm-vm/tests/test_version_diff.py +++ b/debug/risc-v-gsp-rm-vm/tests/test_version_diff.py @@ -262,6 +262,44 @@ class RunVersionDiffTests(unittest.TestCase): self.assertTrue(os.path.exists(os.path.join(out, "version-diff.json"))) +class VersionDiffDryRunTests(unittest.TestCase): + def test_dry_run_exits_zero_and_touches_nothing(self): + with tempfile.TemporaryDirectory() as tmp: + old = os.path.join(tmp, "old.bin") + new = os.path.join(tmp, "new.bin") + for path in (old, new): + with open(path, "wb") as fh: + fh.write(NOP * 8) + before = {} + for name in ("old.bin", "new.bin"): + path = os.path.join(tmp, name) + with open(path, "rb") as fh: + before[name] = (os.path.getmtime(path), fh.read()) + out = os.path.join(tmp, "out") + rc, stdout, _ = _run_main( + version_diff_main, + ["--old", old, "--new", new, "--out", out, "--dry-run", "--probe-instructions", "4"], + ) + self.assertEqual(rc, 0) + plan = json.loads(stdout[: stdout.find("\n[version-diff]")]) + self.assertEqual(plan["format"], "greeneye-version-diff-plan/1") + self.assertEqual(plan["status"], "planned") + self.assertFalse(os.path.exists(out), "dry-run must not create --out") + for name, (mtime, data) in before.items(): + path = os.path.join(tmp, name) + self.assertEqual(os.path.getmtime(path), mtime) + with open(path, "rb") as fh: + self.assertEqual(fh.read(), data) + + def test_dry_run_rm610_refused(self): + rc, _, err = _run_main( + version_diff_main, + ["--old", "rm610.elf", "--new", "new.elf", "--dry-run"], + ) + self.assertEqual(rc, 3) + self.assertIn("docs/23", err) + + class CiReleaseTests(unittest.TestCase): def test_dry_run_exits_zero_and_touches_nothing(self): with tempfile.TemporaryDirectory() as tmp: -- cgit v1.2.3