INNER CODE UNIT · Go
init
yahoo/vssh · client_test.go:68
func init() {
go sshServer()
time.Sleep(time.Second * 3)
}
func TestAddClient(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
config := GetConfigUserPass("vssh", "vssh")
vs := New().StartWithContext(ctx)
vs.AddClient("127.0.0.1:22", config)
_, ok := vs.clients.get("127.0.0.1:22")
if !ok {
t.Error("expect to have 127.0.0.1:22 client but not exist")
}