From 722cbb78beed0b5adee67457ef679f3cbf5fce07 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Fri, 25 Oct 2024 19:21:56 -0700 Subject: [PATCH] Fix interactive test --- tests/test_ssh.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_ssh.py b/tests/test_ssh.py index 07e183b..75afc01 100644 --- a/tests/test_ssh.py +++ b/tests/test_ssh.py @@ -65,13 +65,15 @@ def test_ssh_command_execution(jupyter_server): def test_ssh_interactive(jupyter_server): + # Explicitly call /bin/sh without any args, so we can run without any prompts cmd = [ 'ssh', - ] + [f"-o={o}" for o in get_ssh_client_options(*jupyter_server)] + ['127.0.0.1', 'hostname'] + ] + [f"-o={o}" for o in get_ssh_client_options(*jupyter_server)] + ['127.0.0.1', '/bin/sh'] proc = pexpect.spawn(shlex.join(cmd), echo=False) proc.sendline('hostname') assert proc.readline().decode().strip() == socket.gethostname() + proc.sendline("exit") proc.wait() assert proc.exitstatus == 0