MCPcopy Create free account
hub / github.com/appleboy/easyssh-proxy / TestExitCode

Function TestExitCode

easyssh_test.go:414–428  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

412}
413
414func TestExitCode(t *testing.T) {
415 ssh := &MakeConfig{
416 Server: "localhost",
417 User: "drone-scp",
418 Port: "22",
419 KeyPath: "./tests/.ssh/id_rsa",
420 Timeout: 60 * time.Second,
421 }
422
423 outStr, errStr, isTimeout, err := ssh.Run("set -e;echo 1; mkdir a;mkdir a;echo 2")
424 assert.Equal(t, "1\n", outStr)
425 assert.Equal(t, "mkdir: can't create directory 'a': File exists\n", errStr)
426 assert.True(t, isTimeout)
427 assert.Error(t, err)
428}
429
430func TestSSHWithPassphrase(t *testing.T) {
431 ssh := &MakeConfig{

Callers

nothing calls this directly

Calls 1

RunMethod · 0.95

Tested by

no test coverage detected