]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix tests to use tostring 9361/head
authorAki Tuomi <cmouse@cmouse.fi>
Wed, 29 Jul 2020 10:47:30 +0000 (13:47 +0300)
committerAki Tuomi <cmouse@cmouse.fi>
Wed, 24 Feb 2021 11:35:43 +0000 (13:35 +0200)
regression-tests.dnsdist/test_Advanced.py
regression-tests.dnsdist/test_DynBlocks.py
regression-tests.dnsdist/test_EDNSOptions.py
regression-tests.dnsdist/test_Protobuf.py

index c4eb7c37360ba0db07b093484cbf2379d3c3a127..13fa8a372cb7bc58625cab1a25502a2d44cb9a82 100644 (file)
@@ -1474,7 +1474,7 @@ class TestAdvancedGetLocalAddressOnAnyBind(DNSDistTest):
 
     _config_template = """
     function answerBasedOnLocalAddress(dq)
-      local dest = dq.localaddr:toString()
+      local dest = tostring(dq.localaddr)
       local i, j = string.find(dest, "[0-9.]+")
       local addr = string.sub(dest, i, j)
       local dashAddr = string.gsub(addr, "[.]", "-")
@@ -1942,7 +1942,7 @@ class TestAdvancedLuaRule(DNSDistTest):
         return false
       end
 
-      if dq.qname:toString() ~= 'lua-rule.advanced.tests.powerdns.com.' then
+      if tostring(dq.qname) ~= 'lua-rule.advanced.tests.powerdns.com.' then
         print('invalid qname')
         return false
       end
index 44ad7598d7597cc18b04616a162abe7b8b702abd..3e75af4d7eda2c1bf6dd85e4a0b250887add58fd 100644 (file)
@@ -833,7 +833,7 @@ class TestDynBlockAllowlist(DynBlocksTest):
     function maintenance()
         toBlock = exceedQRate(%d, %d)
         for addr, count in pairs(toBlock) do
-            if addr:toString() == "127.0.0.1" then
+            if tostring(addr) == "127.0.0.1" then
                 allowlisted = true
                 toBlock[addr] = nil
             end
index f1e386e82546fc40a81ab819f370e54903f972e4..2bf76b9706e4db9e5ac608fcca477717fdfa51f8 100644 (file)
@@ -8,7 +8,7 @@ class EDNSOptionsBase(DNSDistTest):
     _ednsTestFunction = """
     function testEDNSOptions(dq)
       local options = dq:getEDNSOptions()
-      local qname = dq.qname:toString()
+      local qname = tostring(dq.qname)
 
       if string.match(qname, 'noedns') then
         if next(options) ~= nil then
index a864e39b3abcaa376b899d3add98a754b013f220..beaab89aba5a915ec2b6562eb7434e731f9b08af 100644 (file)
@@ -144,7 +144,7 @@ class TestProtobuf(DNSDistProtobufTest):
 
     function alterProtobufResponse(dq, protobuf)
       if luasmn:check(dq.qname) then
-        requestor = newCA(dq.remoteaddr:toString())            -- called by testLuaProtobuf()
+        requestor = newCA(tostring(dq.remoteaddr))             -- called by testLuaProtobuf()
         if requestor:isIPv4() then
           requestor:truncate(24)
         else
@@ -179,7 +179,7 @@ class TestProtobuf(DNSDistProtobufTest):
     function alterProtobufQuery(dq, protobuf)
 
       if luasmn:check(dq.qname) then
-        requestor = newCA(dq.remoteaddr:toString())            -- called by testLuaProtobuf()
+        requestor = newCA(tostring(dq.remoteaddr))             -- called by testLuaProtobuf()
         if requestor:isIPv4() then
           requestor:truncate(24)
         else
@@ -200,7 +200,7 @@ class TestProtobuf(DNSDistProtobufTest):
 
         protobuf:setResponseCode(DNSRCode.NXDOMAIN)            -- set protobuf response code to be NXDOMAIN
 
-        local strReqName = dq.qname:toString()                 -- get request dns name
+        local strReqName = tostring(dq.qname)                  -- get request dns name
 
         protobuf:setProtobufResponseType()                     -- set protobuf to look like a response and not a query, with 0 default time