(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func TestSelectServerCache_MatchingIPAndUser(t *testing.T) { |
| 64 | conf := newTestConfig() |
| 65 | |
| 66 | // Search with both IP and user -- should match the specific server |
| 67 | server, index, found := SelectServerCache("admin", "192.168.1.1", conf) |
| 68 | assert.True(t, found) |
| 69 | assert.NotNil(t, server) |
| 70 | assert.Equal(t, 2, index) |
| 71 | assert.Equal(t, "192.168.1.1", server.IP) |
| 72 | assert.Equal(t, "admin", server.User) |
| 73 | assert.Equal(t, "server1-admin", server.Alias) |
| 74 | } |
| 75 | |
| 76 | func TestSelectServerCache_MatchingIPAndUserSecondServer(t *testing.T) { |
| 77 | conf := newTestConfig() |
nothing calls this directly
no test coverage detected