]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
cache.clear() tests: add cache.clear('.', true)
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 17 Aug 2018 16:18:19 +0000 (18:18 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 17 Aug 2018 16:18:19 +0000 (18:18 +0200)
daemon/cache.test/clear.test.lua

index 9a412d3e9dcd52b4e7a5efa7b8c54a417cc4b686..cec5e80c2ef79d9daa0d8128927ff713e5ae1c71 100644 (file)
@@ -173,6 +173,14 @@ local function test_apex()
 end
 
 local function test_root()
+       check_answer('root apex is still in cache',
+                     '.', kres.type.NS, kres.rcode.NOERROR)
+       res = cache.clear('.', true)
+       check_answer('root apex is in no longer cache',
+                     '.', kres.type.NS, kres.rcode.SERVFAIL)
+       check_answer('some other item is still in cache',
+                     '16r.subtree2.', kres.type.A, kres.rcode.NOERROR)
+
        local prev_count = cache.count()
        res = cache.clear('.')
        is(res.count, prev_count, 'full clear reports correct number of entries')