From 4c433dbed15fb14fa781ddc113c76c88a1e0775c Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 29 Mar 2018 23:48:09 +0545 Subject: [PATCH] parent_test: Add explanation. --- tests/parent_test.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/parent_test.py b/tests/parent_test.py index 5473b015..da9f5e15 100644 --- a/tests/parent_test.py +++ b/tests/parent_test.py @@ -21,6 +21,15 @@ class TtyCreateChildTest(unittest2.TestCase): func = staticmethod(mitogen.parent.tty_create_child) def test_dev_tty_open_succeeds(self): + # In the early days of UNIX, a process that lacked a controlling TTY + # would acquire one simply by opening an existing TTY. Linux and OS X + # continue to follow this behaviour, however at least FreeBSD moved to + # requiring an explicit ioctl(). Linux supports it, but we don't yet + # use it there and anyway the behaviour will never change, so no point + # in fixing things that aren't broken. Below we test that + # getpass-loving apps like sudo and ssh get our slave PTY when they + # attempt to open /dev/tty, which is what they both do on attempting to + # read a password. tf = tempfile.NamedTemporaryFile() try: pid, fd = self.func(