(t *testing.T)
| 257 | } |
| 258 | |
| 259 | func TestCache_uncacheable(t *testing.T) { |
| 260 | testCache := newTestCache(t, nil) |
| 261 | |
| 262 | // Create a DNS request. |
| 263 | request := (&dns.Msg{}).SetQuestion("google.com.", dns.TypeA) |
| 264 | // Fill the cache. |
| 265 | reply := (&dns.Msg{}).SetRcode(request, dns.RcodeBadAlg) |
| 266 | |
| 267 | // We are testing that SERVFAIL responses aren't cached |
| 268 | testCache.set(request, reply, upstreamWithAddr, testLogger) |
| 269 | |
| 270 | r, expired, _ := testCache.get(request) |
| 271 | assert.Nil(t, r) |
| 272 | assert.False(t, expired) |
| 273 | } |
| 274 | |
| 275 | func TestCache_concurrent(t *testing.T) { |
| 276 | testCache := newTestCache(t, nil) |
nothing calls this directly
no test coverage detected
searching dependent graphs…