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

Function TestSCPCommandWithPassword

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

Source from the content-addressed store, hash-verified

373}
374
375func TestSCPCommandWithPassword(t *testing.T) {
376 ssh := &MakeConfig{
377 Server: "localhost",
378 User: "drone-scp",
379 Port: "22",
380 Password: "1234",
381 Timeout: 60 * time.Second,
382 }
383
384 err := ssh.Scp("./tests/b.txt", "b.txt")
385 assert.NoError(t, err)
386
387 u, err := user.Lookup("drone-scp")
388 if err != nil {
389 t.Fatalf("Lookup: %v", err)
390 }
391
392 // check file exist
393 if _, err := os.Stat(path.Join(u.HomeDir, "b.txt")); os.IsNotExist(err) {
394 t.Fatalf("SCP-error: %v", err)
395 }
396}
397
398func TestWrongRawKey(t *testing.T) {
399 // wrong key

Callers

nothing calls this directly

Calls 1

ScpMethod · 0.95

Tested by

no test coverage detected