2 Star 6 Fork 1

卧雪Sirk / gosshtool

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
tool_test.go 975 Bytes
Copy Edit Web IDE Raw Blame History
scottkiss authored 2016-06-14 12:00 . support session idle timeout
package gosshtool
import (
"testing"
)
func Test_newSSHClinet(t *testing.T) {
/* config := &SSHClientConfig{
User: "s",
Password: "1223",
Host: "127.0.0.1",
}
sshclient := NewSSHClient(config)
stdout, stderr,session, err := sshclient.Cmd("pwd",nil,nil,0)
if err != nil {
t.Error(err)
}
t.Log(stdout)
t.Log(stderr)
stdout, stderr,session, err = sshclient.Cmd("ls",nil,nil,0)
t.Log(stdout)
t.Log("test")*/
}
func Test_mutiCmd(t *testing.T) {
/* config := &SSHClientConfig{
User: "jack",
Password: "assd",
Host: "31.11.11.11",
}
NewSSHClient(config)
config2 := &SSHClientConfig{
User: "asd",
Password: "daas",
Host: "8.8.8.8",
}
NewSSHClient(config2)
stdout, _, _,err := ExecuteCmd("pwd", "8.8.8.8")
if err != nil {
t.Error(err)
}
t.Log(stdout)
stdout, _,_, err = ExecuteCmd("pwd", "114.215.151.48")
if err != nil {
t.Error(err)
}
t.Log(stdout)*/
t.Log("test")
}

Comment ( 0 )

Sign in for post a comment

Go
1
https://git.oschina.net/scottkiss/gosshtool.git
git@git.oschina.net:scottkiss/gosshtool.git
scottkiss
gosshtool
gosshtool
master

Search