]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
geoipbackend: Add a location test
authorAki Tuomi <cmouse@cmouse.fi>
Tue, 2 Jan 2018 17:06:46 +0000 (19:06 +0200)
committerAki Tuomi <cmouse@cmouse.fi>
Wed, 14 Feb 2018 07:15:53 +0000 (09:15 +0200)
modules/geoipbackend/regression-tests/loc-resolution/command [new file with mode: 0755]
modules/geoipbackend/regression-tests/loc-resolution/description [new file with mode: 0644]
modules/geoipbackend/regression-tests/loc-resolution/expected_result [new file with mode: 0644]
regression-tests/backends/geoip-master

diff --git a/modules/geoipbackend/regression-tests/loc-resolution/command b/modules/geoipbackend/regression-tests/loc-resolution/command
new file mode 100755 (executable)
index 0000000..b592794
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+cleandig loc.geo.example.com LOC ednssubnet $geoipregionip
+cleandig loc.geo.example.com TXT ednssubnet $geoipregionip
diff --git a/modules/geoipbackend/regression-tests/loc-resolution/description b/modules/geoipbackend/regression-tests/loc-resolution/description
new file mode 100644 (file)
index 0000000..51497ac
--- /dev/null
@@ -0,0 +1,2 @@
+This test tries to resolve a straight A record that is directly available in
+the database.
diff --git a/modules/geoipbackend/regression-tests/loc-resolution/expected_result b/modules/geoipbackend/regression-tests/loc-resolution/expected_result
new file mode 100644 (file)
index 0000000..df1335d
--- /dev/null
@@ -0,0 +1,8 @@
+0      loc.geo.example.com.    IN      LOC     30      1 0 0.000 N 1 0 0.000 E 0.00m 1.00m 10000.00m 10.00m
+2      .       IN      OPT     0       AAgACAABIBgBAQEB
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='loc.geo.example.com.', qtype=LOC
+0      loc.geo.example.com.    IN      TXT     30      "1.000000 1.000000"
+2      .       IN      OPT     0       AAgACAABIBgBAQEB
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='loc.geo.example.com.', qtype=TXT
index 74620be747d5e709fabb84e6d2f2587797033d6e..5b7bfd423ce4bd9bdbcdc4e6b299e038fdeaf2a6 100644 (file)
@@ -26,6 +26,9 @@ domains:
       - ns: ns1.example.com
       - ns: ns2.example.com
       - mx: 10 mx.example.com
+    loc.geo.example.com:
+      - loc: "%loc"
+      - txt: "%lat %lon"
     c1.l1.o1.city.geo.example.com:
       - a: 127.0.1.1
     c2.l2.o1.city.geo.example.com: