]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Test for dq.queryTime
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 7 Sep 2022 11:02:31 +0000 (13:02 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 7 Sep 2022 11:02:31 +0000 (13:02 +0200)
regression-tests.recursor-dnssec/test_Lua.py

index f76a3101b52ec86b3cea7231d1284a2ba3c76d05..9ef8a42404a06c3bb142d88e345f337817e61a7c 100644 (file)
@@ -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