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

Function TestGetKeyFile

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

Source from the content-addressed store, hash-verified

32}
33
34func TestGetKeyFile(t *testing.T) {
35 // missing file
36 _, err := getKeyFile("abc", "")
37 assert.Error(t, err)
38 assert.Equal(t, "open abc: no such file or directory", err.Error())
39
40 // wrong format
41 _, err = getKeyFile("./tests/.ssh/id_rsa.pub", "")
42 assert.Error(t, err)
43 assert.Equal(t, "ssh: no key found", err.Error())
44
45 _, err = getKeyFile("./tests/.ssh/id_rsa", "")
46 assert.NoError(t, err)
47
48 _, err = getKeyFile("./tests/.ssh/test", "1234")
49 assert.NoError(t, err)
50}
51
52func TestRunCommandWithFingerprint(t *testing.T) {
53 // wrong fingerprint

Callers

nothing calls this directly

Calls 1

getKeyFileFunction · 0.85

Tested by

no test coverage detected