Permalink
Browse files

Update test suite

Now tests direct and indirect response.
  • Loading branch information...
1 parent 4ca7a06 commit b59a7e3ea72d38ddb8e06f687e9b81de951e02d7 @cmouse cmouse committed Sep 14, 2015
@@ -2,3 +2,6 @@ diff
real_result
*.out
geosec
+region-a-resolution/expected_result
+region-cname-resolution/expected_result
+geo.yaml
@@ -1,4 +1,3 @@
-0 unknown.service.geo.example.com. IN A 30 127.0.0.1
-0 www.geo.example.com. IN CNAME 30 unknown.service.geo.example.com.
+0 www.geo.example.com. IN A 30 127.0.0.1
Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
Reply to question for qname='www.geo.example.com.', qtype=A
@@ -1,4 +0,0 @@
-0 oc.service.geo.example.com. IN A 30 62.236.200.4
-0 www.geo.example.com. IN CNAME 30 oc.service.geo.example.com.
-Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
-Reply to question for qname='www.geo.example.com.', qtype=A
@@ -0,0 +1,2 @@
+#!/bin/sh
+nameserver=$geoipregionip cleandig indirect.geo.example.com A
@@ -0,0 +1,2 @@
+This test tries to resolve a straight A record that is directly available in
+the database.
@@ -43,14 +43,18 @@ domains:
- a: 127.0.0.1
services:
www.geo.example.com: '%cn.service.geo.example.com'
+ indirect.geo.example.com: '%cn.elsewhere.example.com'
EOF
cat > $testsdir/region-a-resolution/expected_result <<EOF
-0 $geoipregion.service.geo.example.com. IN A 30 62.236.200.4
-0 www.geo.example.com. IN CNAME 30 $geoipregion.service.geo.example.com.
+0 www.geo.example.com. IN A 30 62.236.200.4
Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
Reply to question for qname='www.geo.example.com.', qtype=A
EOF
-
+ cat > $testsdir/region-cname-resolution/expected_result <<EOF
+0 indirect.geo.example.com. IN CNAME 30 $geoipregion.elsewhere.example.com.
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='indirect.geo.example.com.', qtype=A
+EOF
# generate pdns.conf for pdnssec
cat > pdns-geoip.conf <<EOF
module-dir=./modules
@@ -68,7 +72,7 @@ EOF
$RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \
--no-shuffle --launch=geoip \
--cache-ttl=$cachettl --experimental-dname-processing --no-config \
- --send-root-referral --distributor-threads=1 \
+ --distributor-threads=1 \
--geoip-zones-file=$testsdir/geo.yaml --module-dir=./modules \
$geoipkeydir &
;;

0 comments on commit b59a7e3

Please sign in to comment.