File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -690,3 +690,29 @@ def test_host_config(self):
690690 msg = "Host config pkey override failed" )
691691 for (server , _ ) in servers :
692692 server .kill ()
693+
694+ def test_pssh_client_override_allow_agent_authentication (self ):
695+ """Test running command with allow_agent set to False"""
696+ client = ParallelSSHClient ([self .host ], port = self .listen_port ,
697+ pkey = self .user_key , allow_agent = False )
698+ output = client .run_command (self .fake_cmd )
699+ expected_exit_code = 0
700+ expected_stdout = [self .fake_resp ]
701+ expected_stderr = []
702+
703+ stdout = list (output [self .host ]['stdout' ])
704+ stderr = list (output [self .host ]['stderr' ])
705+ exit_code = output [self .host ]['exit_code' ]
706+ self .assertEqual (expected_exit_code , exit_code ,
707+ msg = "Got unexpected exit code - %s, expected %s" %
708+ (exit_code ,
709+ expected_exit_code ,))
710+ self .assertEqual (expected_stdout , stdout ,
711+ msg = "Got unexpected stdout - %s, expected %s" %
712+ (stdout ,
713+ expected_stdout ,))
714+ self .assertEqual (expected_stderr , stderr ,
715+ msg = "Got unexpected stderr - %s, expected %s" %
716+ (stderr ,
717+ expected_stderr ,))
718+ del client
You can’t perform that action at this time.
0 commit comments