mirror of
https://github.com/coredns/coredns.git
synced 2025-10-30 01:34:21 -04:00
plugin/cache: fix TTL for negative DNS responses (#2197)
This commit is contained in:
committed by
Chris O'Haver
parent
54df160aa4
commit
dbc2efc49a
@@ -26,8 +26,8 @@ func TestMinimalTTL(t *testing.T) {
|
||||
t.Fatalf("Expected type to be response.NoData, got %s", mt)
|
||||
}
|
||||
dur := MinimalTTL(m, mt) // minTTL on msg is 3600 (neg. ttl on SOA)
|
||||
if dur != time.Duration(3600*time.Second) {
|
||||
t.Fatalf("Expected minttl duration to be %d, got %d", 3600, dur)
|
||||
if dur != time.Duration(1800*time.Second) {
|
||||
t.Fatalf("Expected minttl duration to be %d, got %d", 1800, dur)
|
||||
}
|
||||
|
||||
m.Rcode = dns.RcodeNameError
|
||||
@@ -36,8 +36,8 @@ func TestMinimalTTL(t *testing.T) {
|
||||
t.Fatalf("Expected type to be response.NameError, got %s", mt)
|
||||
}
|
||||
dur = MinimalTTL(m, mt) // minTTL on msg is 3600 (neg. ttl on SOA)
|
||||
if dur != time.Duration(3600*time.Second) {
|
||||
t.Fatalf("Expected minttl duration to be %d, got %d", 3600, dur)
|
||||
if dur != time.Duration(1800*time.Second) {
|
||||
t.Fatalf("Expected minttl duration to be %d, got %d", 1800, dur)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user