~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-09-18 02:51:19 UTC
  • mfrom: (4691.2.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090918025119-eqkrmtj09t2hqs2t
(robertc) Add test suite enforcement of BzrDir objects outside the
        test area. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        # We use this url because while this is no valid URL to connect to this
91
91
        # server instance, the transport needs a URL.
92
92
        url = 'bzr://localhost/'
 
93
        self.permit_url(url)
93
94
        client_medium = medium.SmartSimplePipesClientMedium(
94
95
            process.stdout, process.stdin, url)
95
96
        transport = remote.RemoteTransport(url, medium=client_medium)
110
111
        prefix = 'listening on port: '
111
112
        self.assertStartsWith(port_line, prefix)
112
113
        port = int(port_line[len(prefix):])
113
 
        return process,'bzr://localhost:%d/' % port
 
114
        url = 'bzr://localhost:%d/' % port
 
115
        self.permit_url(url)
 
116
        return process, url
114
117
 
115
118
    def test_bzr_serve_inet_readonly(self):
116
119
        """bzr server should provide a read only filesystem by default."""
165
168
        bzr+ssh:// should cause bzr to run a remote bzr smart server over SSH.
166
169
        """
167
170
        try:
168
 
            from bzrlib.transport.sftp import SFTPServer
 
171
            # SFTPFullAbsoluteServer has a get_url method, and doesn't
 
172
            # override the interface (doesn't change self._vendor).
 
173
            from bzrlib.transport.sftp import SFTPFullAbsoluteServer
169
174
        except ParamikoNotPresent:
170
175
            raise TestSkipped('Paramiko not installed')
171
176
        from bzrlib.tests.stub_sftp import StubServer
211
216
 
212
217
                return True
213
218
 
214
 
        ssh_server = SFTPServer(StubSSHServer)
 
219
        ssh_server = SFTPFullAbsoluteServer(StubSSHServer)
215
220
        # XXX: We *don't* want to override the default SSH vendor, so we set
216
221
        # _vendor to what _get_ssh_vendor returns.
217
222
        self.start_server(ssh_server)
229
234
        try:
230
235
            if sys.platform == 'win32':
231
236
                path_to_branch = os.path.splitdrive(path_to_branch)[1]
232
 
            branch = Branch.open(
233
 
                'bzr+ssh://fred:secret@localhost:%d%s' % (port, path_to_branch))
 
237
            url_suffix = '@localhost:%d%s' % (port, path_to_branch)
 
238
            self.permit_url('bzr+ssh://fred' + url_suffix)
 
239
            branch = Branch.open('bzr+ssh://fred:secret' + url_suffix)
234
240
            self.make_read_requests(branch)
235
241
            # Check we can perform write operations
236
242
            branch.bzrdir.root_transport.mkdir('foo')