From: Ulrich Wisser Date: Thu, 19 Jul 2018 22:36:14 +0000 (-0400) Subject: added tests for new web apis X-Git-Tag: v3.2.0~11^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9991588f468c422cca8001ca8bb297aae4319ea2;p=thirdparty%2Fknot-resolver.git added tests for new web apis added new global bogus_log --- diff --git a/.luacheckrc b/.luacheckrc index 644f69aa2..992011fc9 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -53,6 +53,7 @@ new_globals = { 'stats', 'http', 'trust_anchors', + 'bogus_log', } -- Luacheck < 0.18 doesn't support new_read_globals diff --git a/modules/http/http.test.lua b/modules/http/http.test.lua index e22024b9b..889b405c9 100644 --- a/modules/http/http.test.lua +++ b/modules/http/http.test.lua @@ -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