@@ -194,10 +194,7 @@ def test_pssh_client_hosts_list_part_failure(self):
194194 host in the host list has a failure"""
195195 server2_socket = make_socket ('127.0.0.2' , port = self .listen_port )
196196 server2_port = server2_socket .getsockname ()[1 ]
197- server1 = start_server ({ self .fake_cmd : self .fake_resp },
198- self .listen_socket , fail_auth = True )
199- server2 = start_server ({ self .fake_cmd : self .fake_resp },
200- server2_socket )
197+ server2 = start_server (server2_socket , fail_auth = True )
201198 hosts = ['127.0.0.1' , '127.0.0.2' ]
202199 client = ParallelSSHClient (hosts ,
203200 port = self .listen_port ,
@@ -206,13 +203,21 @@ def test_pssh_client_hosts_list_part_failure(self):
206203 output = client .run_command (self .fake_cmd ,
207204 stop_on_errors = False )
208205 self .assertTrue (hosts [0 ] in output ,
209- msg = "Failed host does not exist in output - output is %s" % (output ,))
210- self .assertTrue (hosts [1 ] in output ,
211206 msg = "Successful host does not exist in output - output is %s" % (output ,))
207+ self .assertTrue (hosts [1 ] in output ,
208+ msg = "Failed host does not exist in output - output is %s" % (output ,))
209+ self .assertTrue ('exception' in output [hosts [1 ]],
210+ msg = "Failed host %s has no exception in output - %s" % (hosts [1 ], output ,))
211+ try :
212+ raise output [hosts [1 ]]['exception' ]
213+ except AuthenticationException :
214+ pass
215+ else :
216+ raise Exception ("Expected AuthenticationException, got %s instead" % (
217+ output [hosts [1 ]]['exception' ],))
212218 del client
213- server1 .kill ()
214219 server2 .kill ()
215-
220+
216221 def test_pssh_client_ssh_exception (self ):
217222 listen_socket = make_socket ('127.0.0.1' )
218223 listen_port = listen_socket .getsockname ()[1 ]
0 commit comments