@@ -1389,8 +1389,8 @@ def test_scp_send_dir(self):
1389
1389
gevent .joinall (cmds , raise_error = True )
1390
1390
self .assertTrue (os .path .isdir (remote_test_dir_abspath ))
1391
1391
self .assertTrue (os .path .isfile (remote_file_abspath ))
1392
- remote_file_data = open (remote_file_abspath , 'r' ).readlines ()
1393
- self .assertEqual (remote_file_data [ 0 ] .strip (), test_file_data )
1392
+ remote_file_data = open (remote_file_abspath , 'r' ).read ()
1393
+ self .assertEqual (remote_file_data .strip (), test_file_data )
1394
1394
except Exception :
1395
1395
raise
1396
1396
finally :
@@ -1496,19 +1496,19 @@ def test_scp_recv(self):
1496
1496
shutil .rmtree (remote_test_path_abs )
1497
1497
shutil .rmtree (local_copied_dir )
1498
1498
1499
- ## OpenSSHServer needs to run in its own thread for this test to work
1500
- ## Race conditions otherwise .
1501
- #
1502
- # def test_tunnel(self):
1503
- # proxy_host = '127.0.0.9'
1504
- # server = OpenSSHServer(listen_ip=proxy_host, port=self.port )
1505
- # server.start_server()
1506
- # client = ParallelSSHClient(
1507
- # [self.host], port =self.port, pkey=self.user_key ,
1508
- # proxy_host=proxy_host, proxy_port= self.port, num_retries=1 ,
1509
- # proxy_pkey=self.user_key,
1510
- # timeout=2 )
1511
- # client.join(client.run_command('echo me') )
1499
+ # This is a unit test, no output is checked, due to race conditions
1500
+ # with running server in same thread .
1501
+ def test_tunnel ( self ):
1502
+ proxy_host = '127.0.0.9'
1503
+ server = OpenSSHServer ( listen_ip = proxy_host , port = self . port )
1504
+ server . start_server ( )
1505
+ client = ParallelSSHClient (
1506
+ [ self . host ], port = self . port , pkey = self . user_key ,
1507
+ proxy_host = proxy_host , proxy_port = self .port , num_retries = 1 ,
1508
+ proxy_pkey = self .user_key ,
1509
+ timeout = 2 )
1510
+ output = client . run_command ( 'echo me' , stop_on_errors = False )
1511
+ self . assertEqual ( self . host , list ( output . keys ())[ 0 ] )
1512
1512
1513
1513
# def test_proxy_remote_host_failure_timeout(self):
1514
1514
# """Test that timeout setting is passed on to proxy to be used for the
0 commit comments