(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestSSHController_TryLogin_WithCacheFound(t *testing.T) { |
| 45 | cfg := newTestMainConfig() |
| 46 | ctrl := NewSSHController("192.168.1.1", cfg) |
| 47 | |
| 48 | // TryLogin calls into SSH launchers which need actual SSH connections. |
| 49 | // We test the configuration resolution and cache lookup logic. |
| 50 | ctrl.targetIP = config.ResolveAlias(ctrl.targetIP, ctrl.configuration) |
| 51 | assert.Equal(t, "192.168.1.1", ctrl.targetIP) |
| 52 | |
| 53 | server, idx, found := config.SelectServerCache("root", ctrl.targetIP, ctrl.configuration) |
| 54 | assert.True(t, found) |
| 55 | assert.NotNil(t, server) |
| 56 | assert.Equal(t, 0, idx) |
| 57 | assert.Equal(t, "192.168.1.1", server.IP) |
| 58 | assert.Equal(t, "root", server.User) |
| 59 | } |
| 60 | |
| 61 | func TestSSHController_TryLogin_CacheNotFound(t *testing.T) { |
| 62 | cfg := newTestMainConfig() |
nothing calls this directly
no test coverage detected