audit: round three on the port — the hardware scan check fails soft

A rig hiccup mid-walk records the scan check as failed and lets the suite
continue, matching its siblings' envelope; a nonexistent --port path
reports as an error instead of a traceback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 10:31:32 +02:00
parent 7716e1e291
commit b3f41caf6e
2 changed files with 21 additions and 17 deletions

View File

@@ -1600,7 +1600,7 @@ def main():
if __name__ == "__main__":
try:
main()
except Error as error:
except (Error, OSError) as error:
print(f"error: {error}", file=sys.stderr)
sys.exit(1)
except KeyboardInterrupt:

View File

@@ -82,6 +82,7 @@ class Suite:
on silicon."""
module = pbrig.load_pureboot(self.rig.d.pureboot)
found = None
try:
for pct in module.scan_ratios():
rate = module.scan_rate(self.rig.d.baud, pct)
self.rig.reset()
@@ -98,6 +99,9 @@ class Suite:
continue
finally:
port.close()
except Exception as error: # noqa: BLE001 — a rig hiccup is a result
self.check("scan walks the probe ladder", False, str(error)[:70])
return
self.check("scan finds the board's rate", found is not None,
"no probe answered" if found is None else f"{found:+d} % of {self.rig.d.baud} Bd")