(t *testing.T)
| 86 | } |
| 87 | |
| 88 | func TestSelectServerCache_NoMatch(t *testing.T) { |
| 89 | conf := newTestConfig() |
| 90 | |
| 91 | // IP that doesn't exist |
| 92 | server, index, found := SelectServerCache("", "10.10.10.10", conf) |
| 93 | assert.False(t, found) |
| 94 | assert.Nil(t, server) |
| 95 | assert.Equal(t, 0, index) |
| 96 | |
| 97 | // User that doesn't match the IP entries |
| 98 | server, index, found = SelectServerCache("nonexistent", "192.168.1.1", conf) |
| 99 | assert.False(t, found) |
| 100 | assert.Nil(t, server) |
| 101 | assert.Equal(t, 0, index) |
| 102 | } |
| 103 | |
| 104 | func TestSelectServerCache_IPMatchesButUserDoesNot(t *testing.T) { |
| 105 | conf := newTestConfig() |
nothing calls this directly
no test coverage detected