(t *testing.T)
| 99 | } |
| 100 | |
| 101 | func TestSSHController_TryLogin_EmptyUser(t *testing.T) { |
| 102 | cfg := newTestMainConfig() |
| 103 | ctrl := NewSSHController("192.168.1.2", cfg) |
| 104 | |
| 105 | // When user is empty, SelectServerCache returns any matching IP |
| 106 | server, idx, found := config.SelectServerCache("", ctrl.targetIP, ctrl.configuration) |
| 107 | assert.True(t, found) |
| 108 | assert.Equal(t, 1, idx) |
| 109 | assert.Equal(t, "192.168.1.2", server.IP) |
| 110 | } |
| 111 | |
| 112 | func TestSSHController_FieldDefaults(t *testing.T) { |
| 113 | cfg := newTestMainConfig() |
nothing calls this directly
no test coverage detected