(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func TestSSHController_TryLogin_UserSpecified(t *testing.T) { |
| 88 | cfg := newTestMainConfig() |
| 89 | ctrl := NewSSHController("192.168.1.1", cfg) |
| 90 | |
| 91 | // When user is specified, SelectServerCache filters by user |
| 92 | _, _, found := config.SelectServerCache("admin", ctrl.targetIP, ctrl.configuration) |
| 93 | assert.False(t, found, "192.168.1.1 has user=root, not admin") |
| 94 | |
| 95 | server, idx, found := config.SelectServerCache("root", ctrl.targetIP, ctrl.configuration) |
| 96 | assert.True(t, found) |
| 97 | assert.Equal(t, 0, idx) |
| 98 | assert.Equal(t, "root", server.User) |
| 99 | } |
| 100 | |
| 101 | func TestSSHController_TryLogin_EmptyUser(t *testing.T) { |
| 102 | cfg := newTestMainConfig() |
nothing calls this directly
no test coverage detected