]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: geoip, add regression test for issue #7051
authorBaptiste Courtois <b.courtois@criteo.com>
Sat, 24 Nov 2018 15:12:03 +0000 (16:12 +0100)
committerBaptiste Courtois <b.courtois@criteo.com>
Fri, 25 Jan 2019 18:44:55 +0000 (19:44 +0100)
The added test does not validate that the weight system is working in
a pseudo-random way. It use a single entry per QType to ensure that
they are all queryable individually or via a ANY question.

The ANY test is done using TCP to avoid test failure due to exceeded
buffer size.

modules/geoipbackend/regression-tests/mixed-weight-resolution/command [new file with mode: 0755]
modules/geoipbackend/regression-tests/mixed-weight-resolution/description [new file with mode: 0644]
modules/geoipbackend/regression-tests/mixed-weight-resolution/expected_result [new file with mode: 0644]
regression-tests/backends/geoip-master

diff --git a/modules/geoipbackend/regression-tests/mixed-weight-resolution/command b/modules/geoipbackend/regression-tests/mixed-weight-resolution/command
new file mode 100755 (executable)
index 0000000..ab78b96
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+cleandig mixed_weight.geo.example.com A
+cleandig mixed_weight.geo.example.com TXT
+cleandig mixed_weight.geo.example.com ANY tcp
+
diff --git a/modules/geoipbackend/regression-tests/mixed-weight-resolution/description b/modules/geoipbackend/regression-tests/mixed-weight-resolution/description
new file mode 100644 (file)
index 0000000..117c1be
--- /dev/null
@@ -0,0 +1,2 @@
+This test ensure we can query all available QType of a mixed weighted
+GeoIP record.
diff --git a/modules/geoipbackend/regression-tests/mixed-weight-resolution/expected_result b/modules/geoipbackend/regression-tests/mixed-weight-resolution/expected_result
new file mode 100644 (file)
index 0000000..bdd6e61
--- /dev/null
@@ -0,0 +1,10 @@
+0      mixed_weight.geo.example.com.   IN      A       30      127.0.0.1
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='mixed_weight.geo.example.com.', qtype=A
+0      mixed_weight.geo.example.com.   IN      TXT     30      "text"
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='mixed_weight.geo.example.com.', qtype=TXT
+0      mixed_weight.geo.example.com.   IN      A       30      127.0.0.1
+0      mixed_weight.geo.example.com.   IN      TXT     30      "text"
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='mixed_weight.geo.example.com.', qtype=ANY
index a1c5585ed73ad0f9a779b308d8333c2600f0118b..60ec0ed8894eaed5df7f7f518bd53450d2921bc8 100644 (file)
@@ -26,6 +26,13 @@ domains:
       - ns: ns1.example.com
       - ns: ns2.example.com
       - mx: 10 mx.example.com
+    mixed_weight.geo.example.com:
+      - a:
+          content: "%ip4"
+          weight: 10
+      - txt:
+          content: text
+          weight: 10
     ip.geo.example.com:
       - a: "%ip4"
       - aaaa: "%ip6"