(t *testing.T)
| 148 | } |
| 149 | |
| 150 | func 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 | |
| 169 | func TestTryLogin_ConcurrencyGreaterThanConnectors(t *testing.T) { |
| 170 | cfg, _ := setupSSHTestConfig(t) |
nothing calls this directly
no test coverage detected