Permalink
Browse files

Add regression-test for #2843

  • Loading branch information...
1 parent df2d20a commit ca1d29c20079b6ecf75ecf162be51d258cc94985 @pieterlexis pieterlexis committed Nov 2, 2015
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+port=5501
+rm -f pdns*.pid sort-records-with-prio/pdns.sqlite3
+
+cat ../modules/gsqlite3backend/schema.sqlite3.sql | \
+ sqlite3 sort-records-with-prio/pdns.sqlite3
+
+../pdns/zone2sql --gsqlite --dnssec=no --named-conf=sort-records-with-prio/named.conf | \
+ sqlite3 sort-records-with-prio/pdns.sqlite3
+
+$RUNWRAPPER ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \
+ --no-shuffle --launch=gsqlite3 --gsqlite3-database=sort-records-with-prio/pdns.sqlite3 \
+ --send-root-referral --cache-ttl=60 --no-config --module-dir=../regression-tests/modules &
+
+sleep 2
+
+timeout 5 ../pdns/saxfr 127.0.0.1 $port example.org showdetails showflags | LC_ALL=C sort
+
+kill $(cat pdns*.pid)
+rm -f pdns*.pid sort-records-with-prio/pdns.sqlite3
@@ -0,0 +1 @@
+Test if we correctly sort a bunch of records with priorities.
@@ -0,0 +1,23 @@
+example.org. 3601 IN SOA dns1.exampledns.org. hostmaster.exampledns.org. 2015102301 43200 3600 604800 3601
+example.org. 1800 IN MX 67 0vec4i2e.example.org.
+example.org. 1800 IN MX 41 3gyvyh121.example.org.
+example.org. 1800 IN MX 58 47g85qpc.example.org.
+example.org. 1800 IN MX 60 5rtl4.example.org.
+example.org. 1800 IN MX 1 6qys3.example.org.
+example.org. 1800 IN MX 40 6wocbxd.example.org.
+example.org. 1800 IN MX 59 7totbdrfl.example.org.
+example.org. 1800 IN MX 64 9f4tja.example.org.
+example.org. 1800 IN MX 66 9vkpekd.example.org.
+example.org. 1800 IN MX 63 cphn494o.example.org.
+example.org. 1800 IN MX 55 h90hhp.example.org.
+example.org. 1800 IN MX 57 hcd16zwm.example.org.
+example.org. 1800 IN MX 56 hpx58ao7.example.org.
+example.org. 1800 IN MX 62 k20r61hi1.example.org.
+example.org. 1800 IN MX 61 l06hv.example.org.
+example.org. 1800 IN MX 65 sgwo0gq.example.org.
+example.org. 1800 IN MX 54 vgo8ks5x.example.org.
+example.org. 1800 IN NS dns1.exampledns.org.
+example.org. 1800 IN NS dns2.exampledns.org.
+example.org. 1800 IN NS dns3.exampledns.org.
+example.org. 1800 IN NS dns4.exampledns.org.
+example.org. 1800 IN NS dns5.exampledns.org.
@@ -0,0 +1,24 @@
+example.org. 1800 IN MX 1 6qys3.example.org.
+example.org. 1800 IN MX 40 6wocbxd.example.org.
+example.org. 1800 IN MX 41 3gyvyh121.example.org.
+example.org. 1800 IN MX 54 vgo8ks5x.example.org.
+example.org. 1800 IN MX 55 h90hhp.example.org.
+example.org. 1800 IN MX 56 hpx58ao7.example.org.
+example.org. 1800 IN MX 57 hcd16zwm.example.org.
+example.org. 1800 IN MX 58 47g85qpc.example.org.
+example.org. 1800 IN MX 59 7totbdrfl.example.org.
+example.org. 1800 IN MX 60 5rtl4.example.org.
+example.org. 1800 IN MX 61 l06hv.example.org.
+example.org. 1800 IN MX 62 k20r61hi1.example.org.
+example.org. 1800 IN MX 63 cphn494o.example.org.
+example.org. 1800 IN MX 64 9f4tja.example.org.
+example.org. 1800 IN MX 65 sgwo0gq.example.org.
+example.org. 1800 IN MX 66 9vkpekd.example.org.
+example.org. 1800 IN MX 67 0vec4i2e.example.org.
+example.org. 1800 IN NS dns1.exampledns.org.
+example.org. 1800 IN NS dns2.exampledns.org.
+example.org. 1800 IN NS dns3.exampledns.org.
+example.org. 1800 IN NS dns4.exampledns.org.
+example.org. 1800 IN NS dns5.exampledns.org.
+example.org. 3601 IN SOA dns1.exampledns.org. hostmaster.exampledns.org. 2015102301 43200 3600 604800 3601
+example.org. 3601 IN SOA dns1.exampledns.org. hostmaster.exampledns.org. 2015102301 43200 3600 604800 3601
@@ -0,0 +1,14 @@
+options {
+ directory "./sort-records-with-prio";
+ recursion no;
+ listen-on port 5300 {
+ 127.0.0.1;
+ };
+ version "Meow!Meow!";
+ minimal-responses yes;
+};
+
+zone "example.org"{
+ type master;
+ file "./example.org";
+};

0 comments on commit ca1d29c

Please sign in to comment.