INNER CODE UNIT · Go

TestIsSessionsMaxOut

yahoo/vssh · client_test.go:103

func TestIsSessionsMaxOut(t *testing.T) {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	vs := New().StartWithContext(ctx)
	vs.AddClient("127.0.0.1:22", &ssh.ClientConfig{}, SetMaxSessions(2))

	client, _ := vs.clients.get("127.0.0.1:22")
	client.curSessions = 2

	if ok := client.isSessionsMaxOut(); !ok {
		t.Error("isSessionMaxOut")
	}
}

func TestSessionsMaxOutRaceQueries(t *testing.T) {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…