34
34
# here but it may be missing if the source is not in sync with the
36
36
self.assertContainsRe(err, "Traceback \\(most recent call last\\)")
38
class TestBreakin(TestCase):
40
def test_breakin(self):
41
# Break in to a debugger while bzr is running
42
# we need to test against a command that will wait for
43
# a while -- bzr serve should do
45
# this may not work on windows but i don't think this use of signals
47
if sys.platform == 'win32':
48
raise TestSkipped('breakin signal not tested on win32')
49
proc = self.start_bzr_subprocess(['serve'])
50
# wait for it to get started
52
# first sigquit pops into debugger
53
os.kill(proc.pid, signal.SIGQUIT)
54
proc.stdin.write("q\n")
56
err = proc.stderr.readline()
57
self.assertContainsRe(err, r'entering debugger')
59
def test_breakin_harder(self):
60
if sys.platform == 'win32':
61
raise TestSkipped('breakin signal not tested on win32')
62
proc = self.start_bzr_subprocess(['serve'])
63
# wait for it to get started
65
# another hit gives the default behaviour of terminating it
66
os.kill(proc.pid, signal.SIGQUIT)
67
# wait for it to go into pdb
69
os.kill(proc.pid, signal.SIGQUIT)