sshd/ssh_test.go

24 lines
415 B
Go
Raw Normal View History

2019-08-30 14:00:29 +08:00
package sshd
import (
"fmt"
"testing"
"time"
)
func TestSSH(t *testing.T) {
myssh := new(StarSSH)
err := myssh.Connect("root", "", "9sday.me", "c:\\id_rsa", 22)
if err != nil {
t.Fatalf("%e", err)
}
shell, err := myssh.NewShell()
if err != nil {
t.Fatalf("%e", err)
}
shell.isprint = true
time.Sleep(5 * time.Second)
a, b, err := shell.ShellClear("apt update\n", 20000)
fmt.Println(a, b, err)
}