fix: keep a crash log for a card read error

Any EIO was read as the window closing, so a failing SD card ended the
interface with 129 and no error.log. The error now counts as a closed
window only once the terminal itself no longer answers tcgetattr.
This commit is contained in:
Abdessamad Derraz committed 2026-10-23 22:13:42 +02:00
1 parent 76da554da9
commit bc4bcadcd3
2 files changed
+45 -6

No files matched your search

+23
View File
@@ -2557,6 +2557,29 @@ class IdleExit(unittest.TestCase):
["RetroBIOS: No button pressed, closing."])
class AReadErrorIsNotAClosedWindow(unittest.TestCase):
"""Any EIO read as the window closing: a failing SD card answers EIO
too, and that run ended 129, no error.log, no launcher message."""
def test_eio_counts_only_once_the_terminal_hung_up(self):
import pty
master, slave = pty.openpty()
try:
card = OSError(errno.EIO, "Input/output error", "/media/card/bios/x.bin")
self.assertFalse(install._closed_terminal(card, slave))
self.assertFalse(install._closed_terminal(
OSError(errno.ENOENT, "No such file"), slave))
os.close(master)
master = -1
self.assertTrue(install._closed_terminal(card, slave))
self.assertTrue(install._closed_terminal(termios.error(errno.EIO, "gone"), slave))
finally:
os.close(slave)
if master >= 0:
os.close(master)
class AuditRoundFour(unittest.TestCase):
"""tui_audit_3.md, each finding held where it was found."""