Skip to content

Commit

Permalink
Fix interactive test
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Oct 26, 2024
1 parent 41d1d67 commit 722cbb7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 722cbb7

Please sign in to comment.