"Fossies" - the Fresh Open Source Software Archive

Member "pdns-auth-4.2.0/regression-tests/backends/geoip-master" (27 Aug 2019, 3643 Bytes) of package /linux/misc/dns/pdns-auth-4.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "geoip-master": 4.1.13_vs_4.2.0.

    1 case $context in
    2 	geoip|geoip-nsec3-narrow)
    3 		set +e
    4 		export geoipregion=${geoipregion:-oc}
    5 		export geoipregionip=${geoipregionip:-1.1.1.1}
    6 		set -e
    7                 testsdir=../modules/geoipbackend/regression-tests/
    8 		if test "$context" = "geoip-nsec3-narrow"; then
    9                   narrow="narrow"
   10                   extracontexts="dnssec nsec3 narrow"
   11                   skipreasons="narrow nsec3 nodyndns"
   12                   geoipdosec="yes"
   13                   geoipkeydir="geoip-dnssec-keydir=$testsdir/geosec"
   14                   rm -rf $testsdir/geosec
   15                   mkdir -p $testsdir/geosec
   16                 else
   17                   skipreasons="nonarrow nonsec3 nodyndns nodnssec"
   18                 fi
   19 		cat > $testsdir/geo.yaml <<EOF
   20 domains:
   21 - domain: geo.example.com
   22   ttl: 30
   23   records:
   24     geo.example.com:
   25       - soa: ns1.example.com hostmaster.example.com 2014090125 7200 3600 1209600 3600
   26       - ns: ns1.example.com
   27       - ns: ns2.example.com
   28       - mx: 10 mx.example.com
   29     mixed_weight.geo.example.com:
   30       - a:
   31           content: "%ip4"
   32           weight: 10
   33       - txt:
   34           content: text
   35           weight: 10
   36     ip.geo.example.com:
   37       - a: "%ip4"
   38       - aaaa: "%ip6"
   39     loc.geo.example.com:
   40       - loc: "%loc"
   41       - txt: "%lat %lon"
   42     c1.l1.o1.city.geo.example.com:
   43       - a: 127.0.1.1
   44     c2.l2.o1.city.geo.example.com:
   45       - a: 127.0.2.1
   46     c3.l3.o1.city.geo.example.com:
   47       - a: 127.0.3.1
   48     continent.geo.example.com:
   49       - txt: "Your continent is %cn"
   50     $geoipregion.service.geo.example.com:
   51       - a: $geoipregionip
   52     unknown.service.geo.example.com:
   53       - a: 127.0.0.1
   54   services:
   55     geo.example.com: '%cn.service.geo.example.com'
   56     www.geo.example.com: '%cn.service.geo.example.com'
   57     indirect.geo.example.com: '%cn.elsewhere.example.com'
   58     city.geo.example.com: '%ci.%re.%cc.city.geo.example.com'
   59 EOF
   60 		cat > $testsdir/region-a-resolution/expected_result <<EOF
   61 0	www.geo.example.com.	IN	A	30	$geoipregionip
   62 2	.	IN	OPT	0	AAgACAABIBgBAQEB
   63 Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
   64 Reply to question for qname='www.geo.example.com.', qtype=A
   65 EOF
   66                 cat > $testsdir/region-cname-resolution/expected_result <<EOF
   67 0	indirect.geo.example.com.	IN	CNAME	30	$geoipregion.elsewhere.example.com.
   68 2	.	IN	OPT	0	AAgACAABIBgBAQEB
   69 Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
   70 Reply to question for qname='indirect.geo.example.com.', qtype=A
   71 EOF
   72                 cat > $testsdir/text-interpolation/expected_result <<EOF
   73 0	continent.geo.example.com.	IN	TXT	30	"Your continent is na"
   74 2	.	IN	OPT	0	AAgACAABIBgBAgME
   75 Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
   76 Reply to question for qname='continent.geo.example.com.', qtype=TXT
   77 EOF
   78 		# generate pdns.conf for pdnsutil
   79 		cat > pdns-geoip.conf <<EOF
   80 module-dir=./modules
   81 launch=geoip
   82 geoip-zones-file=$testsdir/geo.yaml
   83 geoip-database-files=$geoipdatabase
   84 EOF
   85 
   86 		if [ "$geoipdosec" = "yes" ]
   87 		then
   88 			echo "$geoipkeydir" >> pdns-geoip.conf
   89 			$PDNSUTIL --config-dir=. --config-name=geoip secure-zone geo.example.com
   90 			geoipkeydir="--geoip-dnssec-keydir=$testsdir/geosec"
   91 		fi
   92 
   93 		geoipdatabase=${geoipdatabase:-$testsdir/GeoLiteCity.dat}
   94 
   95 		$RUNWRAPPER $PDNS --daemon=no --local-address=$address --local-port=$port --socket-dir=./ \
   96 			--no-shuffle --launch=geoip \
   97 			--cache-ttl=$cachettl --dname-processing --no-config \
   98 			--distributor-threads=1 \
   99                         --geoip-zones-file=$testsdir/geo.yaml --geoip-database-files="$geoipdatabase" \
  100                         --module-dir=./modules --edns-subnet-processing=yes \
  101 			$geoipkeydir &
  102 		;;
  103 
  104 	*)
  105 		nocontext=yes
  106 esac