(self)
| 28 | |
| 29 | class IoctlTests(unittest.TestCase): |
| 30 | def test_ioctl(self): |
| 31 | # If this process has been put into the background, TIOCGPGRP returns |
| 32 | # the session ID instead of the process group id. |
| 33 | ids = (os.getpgrp(), os.getsid(0)) |
| 34 | with open("/dev/tty", "rb") as tty: |
| 35 | r = fcntl.ioctl(tty, termios.TIOCGPGRP, " ") |
| 36 | rpgrp = struct.unpack("i", r)[0] |
| 37 | self.assertIn(rpgrp, ids) |
| 38 | |
| 39 | def _check_ioctl_mutate_len(self, nbytes=None): |
| 40 | buf = array.array('i') |