test: the simavr device stops dumping a flash image nobody reads
Every protocol run wrote the simulated flash to /tmp/tsb_dump.bin on exit - outside the repository, from four tests that run in parallel into one file - for a cross-check no test made. The dump goes, and the device's clock and page size are named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aafaf25a47
commit
bc671618a7
2 files changed
+20
-31
No files matched your search
+3
-5
@@ -23,14 +23,13 @@ class Device:
|
||||
page (via the device's TSB_CONFIG hook) so the password gate and emergency
|
||||
erase are exercisable."""
|
||||
|
||||
def __init__(self, binary, elf, boot_base, dump="/tmp/tsb_dump.bin", config=None):
|
||||
def __init__(self, binary, elf, boot_base, config=None):
|
||||
env = dict(os.environ)
|
||||
if config is not None:
|
||||
env["TSB_CONFIG"] = config
|
||||
self.proc = subprocess.Popen(
|
||||
[binary, elf, boot_base, dump],
|
||||
[binary, elf, boot_base],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, env=env)
|
||||
self.dump = dump
|
||||
self.pty = None
|
||||
deadline = time.time() + 5
|
||||
while time.time() < deadline:
|
||||
@@ -166,7 +165,6 @@ class Host:
|
||||
self.s.write(bytes([CONFIRM]))
|
||||
self._expect(CONFIRM, "emergency mainloop ready")
|
||||
|
||||
|
||||
# A wrong password byte hangs the loader, still draining the line. Two
|
||||
# things must not happen: it must not activate, and it must not fall
|
||||
# through to the emergency erase - a byte the gate has already refused
|
||||
@@ -236,7 +234,7 @@ def scenario_emergency(host):
|
||||
def scenario_wrong_password(host):
|
||||
"""A wrong password byte neither activates the loader nor opens the
|
||||
emergency erase behind it - the oracle carries a dedicated fix for the
|
||||
second, and nothing here exercised either half."""
|
||||
second."""
|
||||
check(host.refuse_password(PW_BYTES[0] ^ 1) == b"", "a wrong password byte draws no reply")
|
||||
check(host.say(0x00) == b"", "a 0 byte after it does not request the erase")
|
||||
check(host.say(CONFIRM) == b"", "and neither does a confirm")
|
||||
|
||||
Reference in new issue
Block a user