diff --git a/ipatests/pytest_ipa/integration/host.py b/ipatests/pytest_ipa/integration/host.py index 1e420dfee..a9758e7dc 100644 --- a/ipatests/pytest_ipa/integration/host.py +++ b/ipatests/pytest_ipa/integration/host.py @@ -206,9 +206,11 @@ class Host(pytest_multihost.host.Host): else: return result - def spawn_expect(self, argv, default_timeout=10, encoding='utf-8'): - """Run command on host using IpaTestExpect""" - return self.transport.spawn_expect(argv, default_timeout, encoding) + def spawn_expect(self, argv, default_timeout=10, encoding='utf-8', + extra_ssh_options=None): + """Run command on remote host using IpaTestExpect""" + return self.transport.spawn_expect(argv, default_timeout, encoding, + extra_ssh_options) class WinHost(pytest_multihost.host.WinHost): """ diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py index 023179a1e..8c4dd9553 100755 --- a/ipatests/pytest_ipa/integration/tasks.py +++ b/ipatests/pytest_ipa/integration/tasks.py @@ -2252,7 +2252,8 @@ class KerberosKeyCopier: mtime_before = get_keytab_mtime() - with self.host.spawn_expect(paths.KTUTIL, default_timeout=5) as e: + with self.host.spawn_expect(paths.KTUTIL, default_timeout=5, + extra_ssh_options=['-t']) as e: e.expect_exact('ktutil:') e.sendline('rkt {}'.format(keytab)) e.expect_exact('ktutil:') diff --git a/ipatests/pytest_ipa/integration/transport.py b/ipatests/pytest_ipa/integration/transport.py index f12df1225..61aba86b6 100644 --- a/ipatests/pytest_ipa/integration/transport.py +++ b/ipatests/pytest_ipa/integration/transport.py @@ -49,9 +49,11 @@ class IPAOpenSSHTransport(OpenSSHTransport): return argv - def spawn_expect(self, argv, default_timeout, encoding): + def spawn_expect(self, argv, default_timeout, encoding, extra_ssh_options): self.log.debug('Starting pexpect ssh session') if isinstance(argv, str): argv = [argv] - argv = self._get_ssh_argv() + ['-t', '-q'] + argv + if extra_ssh_options is None: + extra_ssh_options = [] + argv = self._get_ssh_argv() + ['-q'] + extra_ssh_options + argv return IpaTestExpect(argv, default_timeout, encoding)