(self)
| 2115 | @unittest.skipIf(not os.path.exists('/proc/self/status'), |
| 2116 | "need /proc/self/status") |
| 2117 | def test_restore_signals(self): |
| 2118 | # Blindly assume that cat exists on systems with /proc/self/status... |
| 2119 | default_proc_status = subprocess.check_output( |
| 2120 | ['cat', '/proc/self/status'], |
| 2121 | restore_signals=False) |
| 2122 | for line in default_proc_status.splitlines(): |
| 2123 | if line.startswith(b'SigIgn'): |
| 2124 | default_sig_ign_mask = line |
| 2125 | break |
| 2126 | else: |
| 2127 | self.skipTest("SigIgn not found in /proc/self/status.") |
| 2128 | restored_proc_status = subprocess.check_output( |
| 2129 | ['cat', '/proc/self/status'], |
| 2130 | restore_signals=True) |
| 2131 | for line in restored_proc_status.splitlines(): |
| 2132 | if line.startswith(b'SigIgn'): |
| 2133 | restored_sig_ign_mask = line |
| 2134 | break |
| 2135 | self.assertNotEqual(default_sig_ign_mask, restored_sig_ign_mask, |
| 2136 | msg="restore_signals=True should've unblocked " |
| 2137 | "SIGPIPE and friends.") |
| 2138 | |
| 2139 | def test_start_new_session(self): |
| 2140 | # For code coverage of calling setsid(). We don't care if we get an |
nothing calls this directly
no test coverage detected