From 166bc72ff34f839d205166b3d560e97e8d6cf208 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Wed, 21 Nov 2018 00:23:09 +0300 Subject: [PATCH] Fix tests --- coredns_plugin/ratelimit/ratelimit_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coredns_plugin/ratelimit/ratelimit_test.go b/coredns_plugin/ratelimit/ratelimit_test.go index 8236e923..f8cd9e8f 100644 --- a/coredns_plugin/ratelimit/ratelimit_test.go +++ b/coredns_plugin/ratelimit/ratelimit_test.go @@ -53,7 +53,7 @@ func TestRatelimiting(t *testing.T) { allowed, err = p.allowRequest("127.0.0.1") - if err != nil || !allowed { + if err != nil || allowed { t.Fatal("Second request must have been ratelimited") } } @@ -61,7 +61,7 @@ func TestRatelimiting(t *testing.T) { func TestWhitelist(t *testing.T) { // rate limit is 1 per sec - c := caddy.NewTestController("dns", `ratelimit 1 { whitelist 127.0.0.2 127.0.0.125 }`) + c := caddy.NewTestController("dns", `ratelimit 1 { whitelist 127.0.0.2 127.0.0.1 127.0.0.125 }`) p, err := setupPlugin(c) if err != nil {