sftp tests are slow

Robey Pointer robey at lag.net
Tue Jan 17 18:14:38 GMT 2006


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.

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





More information about the bazaar mailing list