]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
added tests for new web apis
authorUlrich Wisser <ulrich.wisser@iis.se>
Thu, 19 Jul 2018 22:36:14 +0000 (18:36 -0400)
committerPetr Špaček <petr.spacek@nic.cz>
Tue, 11 Dec 2018 16:05:10 +0000 (17:05 +0100)
added new global bogus_log

.luacheckrc
modules/http/http.test.lua

index 644f69aa24b55190ede1cb49f9093cd977da4240..992011fc961df0e6a57077604549f5196178c476 100644 (file)
@@ -53,6 +53,7 @@ new_globals = {
        'stats',
        'http',
        'trust_anchors',
+       'bogus_log',
 }
 
 -- Luacheck < 0.18 doesn't support new_read_globals
index e22024b9be7e068378d6c125d6c35e4dd6b0a521..889b405c9d6de156ed0e1373be93f6d4129495a3 100644 (file)
@@ -58,6 +58,16 @@ else
                same(code, 200, '/metrics page return 200 OK')
                ok(#body > 0, '/metrics page has non-empty body')
                same(mime, 'text/plain; version=0.0.4', '/metrics page has correct content type')
+               -- /metrics serves frequent
+               code, body, mime = http_get(uri .. '/frequent')
+               same(code, 200, '/frequent page return 200 OK')
+               ok(#body > 0, '/frequent page has non-empty body')
+               same(mime, 'text/plain; version=0.0.4', '/frequent page has correct content type')
+               -- /metrics serves bogus
+               code, body, mime = http_get(uri .. '/bogus')
+               same(code, 200, '/bogus page return 200 OK')
+               ok(#body > 0, '/bogus page has non-empty body')
+               same(mime, 'text/plain; version=0.0.4', '/bogus page has correct content type')
                -- /trace serves trace log for requests
                code, body, mime = http_get(uri .. '/trace/localhost/A')
                same(code, 200, '/trace page return 200 OK')
@@ -76,4 +86,4 @@ else
        }
 
        return tests
-end
\ No newline at end of file
+end