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

Function TestSSHWithPassphrase

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

Source from the content-addressed store, hash-verified

428}
429
430func TestSSHWithPassphrase(t *testing.T) {
431 ssh := &MakeConfig{
432 Server: "localhost",
433 User: "drone-scp",
434 Port: "22",
435 KeyPath: "./tests/.ssh/test",
436 Passphrase: "1234",
437 Timeout: 60 * time.Second,
438 }
439
440 outStr, errStr, isTimeout, err := ssh.Run("set -e;echo 1; mkdir test1234;mkdir test1234;echo 2")
441 assert.Equal(t, "1\n", outStr)
442 assert.Equal(t, "mkdir: can't create directory 'test1234': File exists\n", errStr)
443 assert.True(t, isTimeout)
444 assert.Error(t, err)
445}
446
447func TestSCPCommandUseInsecureCipher(t *testing.T) {
448 ssh := &MakeConfig{

Callers

nothing calls this directly

Calls 1

RunMethod · 0.95

Tested by

no test coverage detected