2 Star 7 Fork 1

卧雪Sirk / gosshtool

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tool_test.go 975 Bytes
一键复制 编辑 原始数据 按行查看 历史
scottkiss 提交于 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")
}
Go
1
https://gitee.com/scottkiss/gosshtool.git
git@gitee.com:scottkiss/gosshtool.git
scottkiss
gosshtool
gosshtool
master

搜索帮助