summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjctanner <tanner.jc@gmail.com>2017-11-22 11:19:43 -0500
committerGitHub <noreply@github.com>2017-11-22 11:19:43 -0500
commit218987eac1eb9a5671f996d2887dcca349199e51 (patch)
treef176d52fccdb7f3dfa03ebaf5b1662134c38382f /test
parentaa42a2680eaedd40f70b82269677d0bfdf8120d6 (diff)
downloadansible-218987eac1eb9a5671f996d2887dcca349199e51.tar.gz
ANSIBLE_SSH_USETTY configuration option (#33148)
* Allow the user to circumvent adding -tt on ssh commands to help aid in debugging ssh related problems. * Move config to the plugin * Set version_added * Change yaml section to "connection" * Fix ssh unit tests
Diffstat (limited to 'test')
-rw-r--r--test/units/plugins/connection/test_ssh.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/units/plugins/connection/test_ssh.py b/test/units/plugins/connection/test_ssh.py
index 2ca4d93a8e..0bb5c19cc5 100644
--- a/test/units/plugins/connection/test_ssh.py
+++ b/test/units/plugins/connection/test_ssh.py
@@ -80,6 +80,8 @@ class TestConnectionBaseClass(unittest.TestCase):
conn._build_command.return_value = 'ssh something something'
conn._run = MagicMock()
conn._run.return_value = (0, 'stdout', 'stderr')
+ conn.get_option = MagicMock()
+ conn.get_option.return_value = True
res, stdout, stderr = conn.exec_command('ssh')
res, stdout, stderr = conn.exec_command('ssh', 'this is some data')
@@ -538,6 +540,8 @@ class TestSSHConnectionRetries(object):
self.conn._build_command = MagicMock()
self.conn._build_command.return_value = 'ssh'
+ self.conn.get_option = MagicMock()
+ self.conn.get_option.return_value = True
return_code, b_stdout, b_stderr = self.conn.exec_command('ssh', 'some data')
assert return_code == 0
@@ -563,6 +567,8 @@ class TestSSHConnectionRetries(object):
self.conn._build_command = MagicMock()
self.conn._build_command.return_value = 'ssh'
+ self.conn.get_option = MagicMock()
+ self.conn.get_option.return_value = True
pytest.raises(AnsibleConnectionFailure, self.conn.exec_command, 'ssh', 'some data')
assert self.mock_popen.call_count == 10
@@ -575,6 +581,8 @@ class TestSSHConnectionRetries(object):
self.conn._build_command = MagicMock()
self.conn._build_command.return_value = 'ssh'
+ self.conn.get_option = MagicMock()
+ self.conn.get_option.return_value = True
self.mock_popen.side_effect = [Exception('bad')] * 10
pytest.raises(Exception, self.conn.exec_command, 'ssh', 'some data')