~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-04-16 11:08:11 UTC
  • mfrom: (6521 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6522.
  • Revision ID: jelmer@samba.org-20120416110811-0y996ihqy9o2bb1t
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    urlutils,
35
35
    )
36
36
from bzrlib.branch import Branch
37
 
from bzrlib.bzrdir import BzrDir
 
37
from bzrlib.controldir import ControlDir
38
38
from bzrlib.smart import client, medium
39
39
from bzrlib.smart.server import (
40
40
    BzrServerFactory,
122
122
        SmartTCPServer.hooks.install_named_hook(
123
123
            'server_exception', hook,
124
124
            'test_server_except_hook hook')
125
 
        args = ['--port', 'localhost:0', '--quiet']
 
125
        args = ['--listen', 'localhost', '--port', '0', '--quiet']
126
126
        out, err = self.run_bzr_serve_then_func(args, retcode=0)
127
127
        self.assertEqual('catching KeyboardInterrupt\n', err)
128
128
 
190
190
            finish_bzr_subprocess, and the base url for the server.
191
191
        """
192
192
        # Serve from the current directory
193
 
        args = ['serve', '--port', 'localhost:0']
 
193
        args = ['serve', '--listen', 'localhost', '--port', '0']
194
194
        args.extend(extra_options)
195
195
        process = self.start_bzr_subprocess(args, skip_if_plan_to_signal=True)
196
196
        port_line = process.stderr.readline()
203
203
 
204
204
    def test_bzr_serve_quiet(self):
205
205
        self.make_branch('.')
206
 
        args = ['--port', 'localhost:0', '--quiet']
 
206
        args = ['--listen', 'localhost', '--port', '0', '--quiet']
207
207
        out, err = self.run_bzr_serve_then_func(args, retcode=3)
208
208
        self.assertEqual('', out)
209
209
        self.assertEqual('', err)
221
221
        process, transport = self.start_server_inet(['--allow-writes'])
222
222
 
223
223
        # We get a working branch, and can create a directory
224
 
        branch = BzrDir.open_from_transport(transport).open_branch()
 
224
        branch = ControlDir.open_from_transport(transport).open_branch()
225
225
        self.make_read_requests(branch)
226
226
        transport.mkdir('adir')
227
227
        self.assertInetServerShutsdownCleanly(process)
263
263
        log_fname = os.getcwd() + '/server.log'
264
264
        self.overrideEnv('BZR_LOG', log_fname)
265
265
        process, transport = self.start_server_inet(['-Dhpss'])
266
 
        branch = BzrDir.open_from_transport(transport).open_branch()
 
266
        branch = ControlDir.open_from_transport(transport).open_branch()
267
267
        self.make_read_requests(branch)
268
268
        self.assertInetServerShutsdownCleanly(process)
269
269
        f = open(log_fname, 'rb')
354
354
        t = self.get_transport()
355
355
        t.mkdir('server-root')
356
356
        self.run_bzr_serve_then_func(
357
 
            ['--port', '127.0.0.1:0',
 
357
            ['--listen', '127.0.0.1', '--port', '0',
358
358
             '--directory', t.local_abspath('server-root'),
359
359
             '--allow-writes'],
360
360
            func=self.when_server_started)