MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestTryLogin_CacheIndexCorrect

Function TestTryLogin_CacheIndexCorrect

pkg/control/ssh_integration_test.go:150–167  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func TestTryLogin_CacheIndexCorrect(t *testing.T) {
151 cfg, _ := setupSSHTestConfig(t)
152
153 // Add a cache at index 1 and search for that IP
154 cfg.ServerLists = append(cfg.ServerLists, config.ServerListConfig{
155 IP: "10.0.0.5",
156 Port: "22",
157 User: "deploy",
158 Password: "deploy123",
159 })
160
161 ctrl := NewSSHController("10.0.0.5", cfg)
162 ctrl.TryLogin("deploy", 1, 1*time.Nanosecond)
163
164 assert.Equal(t, "10.0.0.5", ctrl.targetIP)
165 assert.True(t, ctrl.cacheIsFound)
166 assert.Equal(t, 1, ctrl.cacheIndex)
167}
168
169func TestTryLogin_ConcurrencyGreaterThanConnectors(t *testing.T) {
170 cfg, _ := setupSSHTestConfig(t)

Callers

nothing calls this directly

Calls 3

TryLoginMethod · 0.95
setupSSHTestConfigFunction · 0.85
NewSSHControllerFunction · 0.85

Tested by

no test coverage detected