From 9e45e188a9e92f97c85e71fec69a2ff9c32807e9 Mon Sep 17 00:00:00 2001 From: Baptiste Courtois Date: Sat, 24 Nov 2018 16:12:03 +0100 Subject: [PATCH] auth: geoip, add regression test for issue #7051 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. --- .../regression-tests/mixed-weight-resolution/command | 5 +++++ .../mixed-weight-resolution/description | 2 ++ .../mixed-weight-resolution/expected_result | 10 ++++++++++ regression-tests/backends/geoip-master | 7 +++++++ 4 files changed, 24 insertions(+) create mode 100755 modules/geoipbackend/regression-tests/mixed-weight-resolution/command create mode 100644 modules/geoipbackend/regression-tests/mixed-weight-resolution/description create mode 100644 modules/geoipbackend/regression-tests/mixed-weight-resolution/expected_result diff --git a/modules/geoipbackend/regression-tests/mixed-weight-resolution/command b/modules/geoipbackend/regression-tests/mixed-weight-resolution/command new file mode 100755 index 0000000000..ab78b966bb --- /dev/null +++ b/modules/geoipbackend/regression-tests/mixed-weight-resolution/command @@ -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 index 0000000000..117c1bee58 --- /dev/null +++ b/modules/geoipbackend/regression-tests/mixed-weight-resolution/description @@ -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 index 0000000000..bdd6e61dc9 --- /dev/null +++ b/modules/geoipbackend/regression-tests/mixed-weight-resolution/expected_result @@ -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 diff --git a/regression-tests/backends/geoip-master b/regression-tests/backends/geoip-master index a1c5585ed7..60ec0ed889 100644 --- a/regression-tests/backends/geoip-master +++ b/regression-tests/backends/geoip-master @@ -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" -- 2.47.2