INNER CODE UNIT · Go

TestOnDemand

yahoo/vssh · client_test.go:268

func TestOnDemand(t *testing.T) {
	vs := New().Start().OnDemand()

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	timeout, _ := time.ParseDuration("2s")
	config := GetConfigUserPass("vssh", "vssh")
	vs.AddClient(testSrvAddr, config, SetMaxSessions(2), DisableRequestPty())

	d, _ := vs.Wait()
	if d != 0 {
		t.Error("expect delay zero but got,", d)
	}

	time.Sleep(time.Second)

	client, ok := vs.clients.get(testSrvAddr)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…