From: Otto Moerbeek Date: Wed, 7 Sep 2022 11:02:31 +0000 (+0200) Subject: Test for dq.queryTime X-Git-Tag: rec-4.9.0-alpha0~23^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ccb484cad712452b8bd5c13f629a48fd4e34bb9;p=thirdparty%2Fpdns.git Test for dq.queryTime --- diff --git a/regression-tests.recursor-dnssec/test_Lua.py b/regression-tests.recursor-dnssec/test_Lua.py index f76a3101b5..9ef8a42404 100644 --- a/regression-tests.recursor-dnssec/test_Lua.py +++ b/regression-tests.recursor-dnssec/test_Lua.py @@ -99,6 +99,13 @@ class GettagRecursorTest(RecursorTest): return true end + local tm = os.time() + if dq.queryTime.tv_sec < tm - 1 or dq.queryTime.tv_sec > tm + 1 then + pdnslog("queryTime is wrong") + dq.rcode = pdns.REFUSED + return true + end + if dq.qtype == pdns.A then dq:addAnswer(pdns.A, '192.0.2.1') elseif dq.qtype == pdns.AAAA then