diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-14 21:26:47 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-09-15 17:24:42 -0300 |
| commit | a624a56e289e4a02a411f83741f0f2c9fc0f0b2e (patch) | |
| tree | b87e3ca10dd1c4417112164f792b5da1e26de0a6 /test/v9fs_driver_test.py | |
| parent | 95681ff7017b8a9e4c8f9fa6a7371d1233432f2f (diff) | |
| download | pardes-a624a56e289e4a02a411f83741f0f2c9fc0f0b2e.tar.gz pardes-a624a56e289e4a02a411f83741f0f2c9fc0f0b2e.zip | |
Add Linux Tty9p mounted terminals and forward raw TTY keys
Diffstat (limited to 'test/v9fs_driver_test.py')
| -rw-r--r-- | test/v9fs_driver_test.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/v9fs_driver_test.py b/test/v9fs_driver_test.py new file mode 100644 index 00000000..9781c4fe --- /dev/null +++ b/test/v9fs_driver_test.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +"""Unprivileged regression checks for the v9fs helper launcher.""" +import os +import sys +import unittest + +from v9fs import run_helper + + +class HelperLaunchTests(unittest.TestCase): + def test_preserves_session_for_terminal_scoped_sudo_credentials(self): + output = run_helper([sys.executable, '-c', 'import os; print(os.getsid(0))']) + self.assertEqual(int(output), os.getsid(0)) + + def test_failure_preserves_diagnostics(self): + with self.assertRaisesRegex(RuntimeError, r'(?s)failed \(7\).*mount refused'): + run_helper([sys.executable, '-c', + 'import sys; print("mount refused", file=sys.stderr); sys.exit(7)']) + + def test_timeout_is_not_a_passing_probe(self): + with self.assertRaisesRegex(RuntimeError, 'timed out; no compatibility result'): + run_helper([sys.executable, '-c', 'import time; time.sleep(60)'], timeout=.1) + + +if __name__ == '__main__': + unittest.main() |
