sftp tests are slow

Martin Pool mbp at sourcefrog.net
Wed Jan 18 04:05:54 GMT 2006


On 17 Jan 2006, John A Meinel <john at arbash-meinel.com> wrote:
> Robey Pointer wrote:
> > 
> > On 15 Jan 2006, at 17:48, John Arbash Meinel wrote:
> > 
> >> Robert Collins wrote:
> >>> On Thu, 2006-01-12 at 19:48 +1100, Martin Pool wrote:
> >>>
> >>>> As I understand it, SFTP is fairly well layered above SSH: you can run
> >>>> it equally well over a plain tcp socket.
> >>>>
> >>>> Why can't we run the SFTP tests over an in-process representation of a
> >>>> plain socket?  Doing negotiation, encryption, etc is not going to prove
> >>>> anything much useful about whether we're using SFTP in the right way.

On further consideration it's better not to use a simulated socket, but
rather open a socketpair with the sftp server on one end.  On unix we
could use socketpair() but for cross-platform simplicity it's probably
better just to start a TCP server on a transient port.
> > Yeah, you wouldn't have to modify paramiko.Transport at all.  Just use a
> > vendor of something like ('loopback:%d' % port) and add a little bit of
> > glue.
> 
> Right, I think the vendor would be 'loopback', and the path would still
> be sftp://joe@localhost:<port>/
> Just the _get_ssh_vendor() would change.
> Otherwise, we are testing a different Transport (since it would be
> registered as something other than sftp://).

Great!

> I would like us to keep the StubServer and StubSFTPServer around for a
> little while, and just create a single test which checks that we can
> connect to a (semi-)real sftp server.

I think we might as well since we have it.  One test won't slow it down
much and it might catch something.

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060118/7f777557/attachment.pgp 


More information about the bazaar mailing list