From: Peter van Dijk Date: Tue, 2 Apr 2019 12:10:59 +0000 (+0200) Subject: adjust indexes in tests X-Git-Tag: dnsdist-1.4.0-alpha1~29^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=63101b751764231e3213b0a505e70a419594fdf5;p=thirdparty%2Fpdns.git adjust indexes in tests --- diff --git a/regression-tests.dnsdist/test_EDNSOptions.py b/regression-tests.dnsdist/test_EDNSOptions.py index f5838bf40c..1a730216d5 100644 --- a/regression-tests.dnsdist/test_EDNSOptions.py +++ b/regression-tests.dnsdist/test_EDNSOptions.py @@ -23,17 +23,17 @@ class EDNSOptionsBase(DNSDistTest): if options[EDNSOptionCode.COOKIE]:count() ~= 2 then return DNSAction.Spoof, "192.0.2.2" end - if options[EDNSOptionCode.COOKIE]:getValues()[0]:len() ~= 16 then + if options[EDNSOptionCode.COOKIE]:getValues()[1]:len() ~= 16 then return DNSAction.Spoof, "192.0.2.3" end - if options[EDNSOptionCode.COOKIE]:getValues()[1]:len() ~= 16 then + if options[EDNSOptionCode.COOKIE]:getValues()[2]:len() ~= 16 then return DNSAction.Spoof, "192.0.2.4" end elseif string.match(qname, 'cookie') then if options[EDNSOptionCode.COOKIE] == nil then return DNSAction.Spoof, "192.0.2.1" end - if options[EDNSOptionCode.COOKIE]:count() ~= 1 or options[EDNSOptionCode.COOKIE]:getValues()[0]:len() ~= 16 then + if options[EDNSOptionCode.COOKIE]:count() ~= 1 or options[EDNSOptionCode.COOKIE]:getValues()[1]:len() ~= 16 then return DNSAction.Spoof, "192.0.2.2" end end @@ -42,7 +42,7 @@ class EDNSOptionsBase(DNSDistTest): if options[EDNSOptionCode.ECS] == nil then return DNSAction.Spoof, "192.0.2.51" end - if options[EDNSOptionCode.ECS]:count() ~= 1 or options[EDNSOptionCode.ECS]:getValues()[0]:len() ~= 8 then + if options[EDNSOptionCode.ECS]:count() ~= 1 or options[EDNSOptionCode.ECS]:getValues()[1]:len() ~= 8 then return DNSAction.Spoof, "192.0.2.52" end end @@ -51,7 +51,7 @@ class EDNSOptionsBase(DNSDistTest): if options[EDNSOptionCode.ECS] == nil then return DNSAction.Spoof, "192.0.2.101" end - if options[EDNSOptionCode.ECS]:count() ~= 1 or options[EDNSOptionCode.ECS]:getValues()[0]:len() ~= 20 then + if options[EDNSOptionCode.ECS]:count() ~= 1 or options[EDNSOptionCode.ECS]:getValues()[1]:len() ~= 20 then return DNSAction.Spoof, "192.0.2.102" end end