Skip to content

Instantly share code, notes, and snippets.

@ryantm
Created December 5, 2023 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryantm/4963855cc0ff8fe688ab96c7b54d5e87 to your computer and use it in GitHub Desktop.
Save ryantm/4963855cc0ff8fe688ab96c7b54d5e87 to your computer and use it in GitHub Desktop.
func TestSSH(t *testing.T) {
//setup ssh session
err := session.RequestPty("dumb", 25, 80, ssh.TerminalModes{ssh.ECHO: 0,ssh.ONLCR: 0,})
require.NoError(t, err)
output, err := session.Output("echo hello world")
require.NoError(t, err)
require.Equal(t, "hello world\n", string(output)) //here we get output = ""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment