@@ -1389,8 +1389,8 @@ def test_scp_send_dir(self):
13891389 gevent .joinall (cmds , raise_error = True )
13901390 self .assertTrue (os .path .isdir (remote_test_dir_abspath ))
13911391 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 )
13941394 except Exception :
13951395 raise
13961396 finally :
@@ -1496,19 +1496,19 @@ def test_scp_recv(self):
14961496 shutil .rmtree (remote_test_path_abs )
14971497 shutil .rmtree (local_copied_dir )
14981498
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 ] )
15121512
15131513# def test_proxy_remote_host_failure_timeout(self):
15141514# """Test that timeout setting is passed on to proxy to be used for the
0 commit comments