mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
26 lines
395 B
Go
26 lines
395 B
Go
package ssh
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"yunion.io/x/log"
|
|
)
|
|
|
|
const (
|
|
username = "root"
|
|
host = "10.168.222.245"
|
|
password = "123@openmag"
|
|
)
|
|
|
|
func TestRun(t *testing.T) {
|
|
client, err := NewClient(host, 22, username, password, "")
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
out, err := client.Run("ls", "uname -a", "date", "hostname")
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
log.Infof("output: %#v", out)
|
|
}
|