(t *testing.T)
| 127 | } |
| 128 | |
| 129 | func TestTryLogin_MultipleCachesForSameIP(t *testing.T) { |
| 130 | cfg, _ := setupSSHTestConfig(t) |
| 131 | |
| 132 | // Add another cache for same IP with different user |
| 133 | cfg.ServerLists = append(cfg.ServerLists, config.ServerListConfig{ |
| 134 | IP: "192.168.1.1", |
| 135 | Port: "2222", |
| 136 | User: "admin", |
| 137 | Password: "adminpass", |
| 138 | Alias: "server1-admin", |
| 139 | }) |
| 140 | |
| 141 | ctrl := NewSSHController("192.168.1.1", cfg) |
| 142 | ctrl.TryLogin("", 1, 1*time.Nanosecond) |
| 143 | |
| 144 | assert.Equal(t, "192.168.1.1", ctrl.targetIP) |
| 145 | // Should find the first matching cache |
| 146 | assert.True(t, ctrl.cacheIsFound) |
| 147 | assert.Equal(t, 0, ctrl.cacheIndex) |
| 148 | } |
| 149 | |
| 150 | func TestTryLogin_CacheIndexCorrect(t *testing.T) { |
| 151 | cfg, _ := setupSSHTestConfig(t) |
nothing calls this directly
no test coverage detected