From ca1d29c20079b6ecf75ecf162be51d258cc94985 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 2 Nov 2015 17:29:36 +0100 Subject: [PATCH] Add regression-test for #2843 --- .../sort-records-with-prio/command | 21 ++++++++++++++++ .../sort-records-with-prio/description | 1 + .../sort-records-with-prio/example.org | 23 ++++++++++++++++++ .../sort-records-with-prio/expected_result | 24 +++++++++++++++++++ .../sort-records-with-prio/named.conf | 14 +++++++++++ 5 files changed, 83 insertions(+) create mode 100755 regression-tests.nobackend/sort-records-with-prio/command create mode 100644 regression-tests.nobackend/sort-records-with-prio/description create mode 100644 regression-tests.nobackend/sort-records-with-prio/example.org create mode 100644 regression-tests.nobackend/sort-records-with-prio/expected_result create mode 100644 regression-tests.nobackend/sort-records-with-prio/named.conf diff --git a/regression-tests.nobackend/sort-records-with-prio/command b/regression-tests.nobackend/sort-records-with-prio/command new file mode 100755 index 000000000..0ea7e9643 --- /dev/null +++ b/regression-tests.nobackend/sort-records-with-prio/command @@ -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 diff --git a/regression-tests.nobackend/sort-records-with-prio/description b/regression-tests.nobackend/sort-records-with-prio/description new file mode 100644 index 000000000..40a15c422 --- /dev/null +++ b/regression-tests.nobackend/sort-records-with-prio/description @@ -0,0 +1 @@ +Test if we correctly sort a bunch of records with priorities. diff --git a/regression-tests.nobackend/sort-records-with-prio/example.org b/regression-tests.nobackend/sort-records-with-prio/example.org new file mode 100644 index 000000000..8f09f2834 --- /dev/null +++ b/regression-tests.nobackend/sort-records-with-prio/example.org @@ -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. diff --git a/regression-tests.nobackend/sort-records-with-prio/expected_result b/regression-tests.nobackend/sort-records-with-prio/expected_result new file mode 100644 index 000000000..b7a971725 --- /dev/null +++ b/regression-tests.nobackend/sort-records-with-prio/expected_result @@ -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 diff --git a/regression-tests.nobackend/sort-records-with-prio/named.conf b/regression-tests.nobackend/sort-records-with-prio/named.conf new file mode 100644 index 000000000..888f356e6 --- /dev/null +++ b/regression-tests.nobackend/sort-records-with-prio/named.conf @@ -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"; +}; -- 2.40.0