sftp tests are slow

John A Meinel john at arbash-meinel.com
Tue Jan 17 18:55:01 GMT 2006


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.
>>>
>>>
>>> Yup, I agree with this.
>>>
>>
>> Same here. I guess the person to ask is Robey... How hard is it to
>> change the underlying paramiko.Transport() connection to just being a
>> connection to a socket?
>>
>> It seems like we could hook into the '_get_ssh_vendor()', and have one
>> vendor be 'tcp_socket', or something like that.
>> Then the test suite could override the default ssh vendor, and spawn the
>> TCPSocketSFTPServer.
> 
> 
> 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://).

> 
> I like this idea a lot.  It simplifies the tests, isolates them more by
> removing things we don't really need to test (the ssh transport layer),
> and will probably remove more code from SFTPTransportTest than it adds.
> 
> We wouldn't be testing the auth mechanism this way, but I'm not sure
> we're really testing it now.  I think it's just using fake
> login/password and our stub server is ignoring it.
> 
> I was going to try this out, but I forgot we had relatives in for the
> holiday weekend, so I didn't.  But I'll probably try it this week unless
> someone beats me to it.
> 
> robey
> 
> 

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.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060117/04306bf9/attachment.pgp 


More information about the bazaar mailing list