[rfc] [patch] sftp unit tests without ssh

Robert Collins robertc at robertcollins.net
Mon Jan 23 06:14:55 GMT 2006


On Sun, 2006-01-22 at 23:23 -0600, John A Meinel wrote:
> Robert Collins wrote:
> > On Sun, 2006-01-22 at 22:09 -0600, John A Meinel wrote:
> >> Robey Pointer wrote:
> >>> Here's a patch to add a subclass of SFTPServer (called
> >>> SFTPServerWithoutSSH) that sets up a fake sftp server over loopback but
> >>> uses a special ssh vendor ("loopback") which just wraps a plain socket
> >>> instead of setting up both ends of an SSH Transport.  What this means is
> >>> that tests using SFTPServerWithoutSSH will use sftp without all the
> >>> overhead of actually setting up a secure channel.
> >>>
> >>> On my ibook, it drops the './bzr selftest' time from about 5 minutes to
> >>> about 3 minutes -- pretty significant.
> >>>
> >>> We discussed having at least one test still use a full sftp-over-ssh
> >>> setup.  I didn't do that because I'm not entirely sure how, but it
> >>> should just be a matter of using SFTPServer for a test instead of
> >>> SFTPServerWithoutSSH.
> >> I think just a simple test where we create an SFTPServer, and then use
> >> 't = get_transport('sftp://localhost')'.
> >>
> >> But I'm not sure where this would fit with Robert's adapting transports
> >> stuff.
> > 
> > I haven't read the rest yet - just addressing this specific bit.
> > 
> > This sits as an internal-to-the-sftp-code test. I.e.
> > bzrlib.tests.test_sftp.TestFullHandshaking.test_local_connection
> > 
> > or some such. The adapting tests are for verifing the correctness of the
> > implementation; this test is to check that the ssh<->sftp piece that we
> > are eliminating elsewhere works correctly - and as such is not part of
> > the general interface behaviour.
> > 
> > Rob
> 
> I agree. I didn't think it would be part of the Transport test. I just
> didn't know exactly how to write a test which uses a SFTPServer without
> going through the adapter.

Oh! thats easy. TestCaseWithSFTPServer in tests.test_sftp_transport.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060123/9035a933/attachment.pgp 


More information about the bazaar mailing list