@@ 94-104 (lines=11) @@ | ||
91 | wait_for_strings(client.read, TIMEOUT, '3579') |
|
92 | ||
93 | ||
94 | def test_sig_usr2(): |
|
95 | with TestProcess(sys.executable, '-u', HELPER, 'test_oneshot_on_usr2') as service: |
|
96 | with dump_on_error(service.read): |
|
97 | wait_for_strings(service.read, TIMEOUT, |
|
98 | 'Not patching os.fork and os.forkpty. Oneshot activation is done by signal') |
|
99 | with TestProcess('manhole-cli', '--signal=USR2', str(service.proc.pid), bufsize=0, |
|
100 | stdin=subprocess.PIPE) as client: |
|
101 | with dump_on_error(client.read): |
|
102 | wait_for_strings(client.read, TIMEOUT, '(ManholeConsole)', '>>>') |
|
103 | client.proc.stdin.write(b"1234+2345\n") |
|
104 | wait_for_strings(client.read, TIMEOUT, '3579') |
|
105 | ||
106 | ||
107 | def test_sig_usr2_full(): |
|
@@ 82-91 (lines=10) @@ | ||
79 | wait_for_strings(client.read, TIMEOUT, '3579') |
|
80 | ||
81 | ||
82 | def test_path(): |
|
83 | with TestProcess(sys.executable, HELPER, 'test_simple') as service: |
|
84 | with dump_on_error(service.read): |
|
85 | wait_for_strings(service.read, TIMEOUT, '/tmp/manhole-') |
|
86 | with TestProcess('manhole-cli', '/tmp/manhole-%s' % service.proc.pid, bufsize=0, |
|
87 | stdin=subprocess.PIPE) as client: |
|
88 | with dump_on_error(client.read): |
|
89 | wait_for_strings(client.read, TIMEOUT, '(ManholeConsole)', '>>>') |
|
90 | client.proc.stdin.write(b"1234+2345\n") |
|
91 | wait_for_strings(client.read, TIMEOUT, '3579') |
|
92 | ||
93 | ||
94 | def test_sig_usr2(): |
|
@@ 120-130 (lines=11) @@ | ||
117 | wait_for_strings(client.read, TIMEOUT, '3579') |
|
118 | ||
119 | ||
120 | def test_sig_usr2_number(): |
|
121 | with TestProcess(sys.executable, '-u', HELPER, 'test_oneshot_on_usr2') as service: |
|
122 | with dump_on_error(service.read): |
|
123 | wait_for_strings(service.read, TIMEOUT, |
|
124 | 'Not patching os.fork and os.forkpty. Oneshot activation is done by signal') |
|
125 | with TestProcess('manhole-cli', '-s', str(int(signal.SIGUSR2)), str(service.proc.pid), bufsize=0, |
|
126 | stdin=subprocess.PIPE) as client: |
|
127 | with dump_on_error(client.read): |
|
128 | wait_for_strings(client.read, TIMEOUT, '(ManholeConsole)', '>>>') |
|
129 | client.proc.stdin.write(b"1234+2345\n") |
|
130 | wait_for_strings(client.read, TIMEOUT, '3579') |
|
131 |