~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_breakin.py

  • Committer: Martin Pool
  • Date: 2008-11-07 05:26:44 UTC
  • mto: (3815.3.2 1.9)
  • mto: This revision was merged to the branch mainline in revision 3827.
  • Revision ID: mbp@sourcefrog.net-20081107052644-vdkxw54zv42s9f6n
merge fix for #293054, ssl on python2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import sys
23
23
import time
24
24
 
25
 
from bzrlib.tests import TestCase, TestSkipped
26
 
 
27
 
 
28
 
class TestBreakin(TestCase):
 
25
from bzrlib import tests
 
26
 
 
27
 
 
28
class TestBreakin(tests.TestCase):
29
29
    # FIXME: If something is broken, these tests may just hang indefinitely in
30
30
    # wait() waiting for the child to exit when it's not going to.
31
31
 
32
32
    def setUp(self):
33
33
        if sys.platform == 'win32':
34
 
            raise TestSkipped('breakin signal not tested on win32')
 
34
            raise tests.TestSkipped('breakin signal not tested on win32')
35
35
        super(TestBreakin, self).setUp()
36
36
 
 
37
    def _dont_SIGQUIT_on_darwin(self):
 
38
        if sys.platform == 'darwin':
 
39
            # At least on Leopard and with python 2.6, this test will raise a
 
40
            # popup window asking if the python failure should be reported to
 
41
            # Apple... That's not the point of the test :) Marking the test as
 
42
            # not applicable Until we find a way to disable that intrusive
 
43
            # behavior... --vila20080611
 
44
            raise tests.TestNotApplicable(
 
45
                '%s raises a popup on OSX' % self.id())
 
46
 
37
47
    # port 0 means to allocate any port
38
48
    _test_process_args = ['serve', '--port', 'localhost:0']
39
49
 
53
63
        self.assertContainsRe(err, r'entering debugger')
54
64
 
55
65
    def test_breakin_harder(self):
 
66
        self._dont_SIGQUIT_on_darwin()
56
67
        proc = self.start_bzr_subprocess(self._test_process_args,
57
68
                env_changes=dict(BZR_SIGQUIT_PDB=None))
58
69
        # wait for it to get started, and print the 'listening' line
78
89
            self.fail("subprocess wasn't terminated by repeated SIGQUIT")
79
90
 
80
91
    def test_breakin_disabled(self):
 
92
        self._dont_SIGQUIT_on_darwin()
81
93
        proc = self.start_bzr_subprocess(self._test_process_args,
82
94
                env_changes=dict(BZR_SIGQUIT_PDB='0'))
83
95
        # wait for it to get started, and print the 'listening' line