Verify owned TTY cleanup before reporting stop

This commit is contained in:
FrameBridge contributors committed 2026-10-27 16:54:03 -04:00
1 parent ba17412c60
commit f6b14c5210
8 files changed
+759 -34

No files matched your search

+4 -2
View File
@@ -254,8 +254,10 @@ class PortableSudoLimitsTests(SudoControlTests):
self.assertEqual(error.exception.code, "TTY_SUDO_SIZE_INVALID")
def test_actual_nnp_mismatch_rolls_back_candidate(self):
with mock.patch.object(self.controller, "_inspect",
return_value={"no_new_privs": 0, "busy": False}):
original = self.controller._inspect
def mismatch(record):
return {**original(record), "no_new_privs": 0}
with mock.patch.object(self.controller, "_inspect", side_effect=mismatch):
with self.assertRaises(control.SudoControlError) as error:
self.controller.launch(uuid.uuid4().hex, mode="off")
self.assertEqual(error.exception.code, "TTY_SUDO_PRIVILEGE_STATE_MISMATCH")