]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add test for comments in forward-zones-file 2554/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 15 Dec 2015 13:56:53 +0000 (14:56 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 15 Dec 2015 13:56:53 +0000 (14:56 +0100)
.travis.yml
regression-tests.recursor/comments-in-forward-zones-file/command [new file with mode: 0755]
regression-tests.recursor/comments-in-forward-zones-file/description [new file with mode: 0644]
regression-tests.recursor/comments-in-forward-zones-file/expected_result [new file with mode: 0644]
regression-tests.recursor/config.sh

index 08927f0459bc8fbe7d1ba24c523408c618bef232..2cc026a0405732ea3c8628973f01cfa19398f40f 100644 (file)
@@ -69,6 +69,7 @@ before_script:
     unbound-host
     validns
     default-jre
+    jq
   - cd ..
   - wget http://www.verisignlabs.com/dnssec-tools/packages/jdnssec-tools-0.12.tar.gz
   - sudo tar xfz jdnssec-tools-0.12.tar.gz --strip-components=1 -C /
diff --git a/regression-tests.recursor/comments-in-forward-zones-file/command b/regression-tests.recursor/comments-in-forward-zones-file/command
new file mode 100755 (executable)
index 0000000..dd28cdf
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+curl -s -H 'X-API-Key: secret' 127.0.0.1:8082/api/v1/servers/localhost/zones | jq '.[] | select(.kind=="Forwarded")'
diff --git a/regression-tests.recursor/comments-in-forward-zones-file/description b/regression-tests.recursor/comments-in-forward-zones-file/description
new file mode 100644 (file)
index 0000000..e5c84e3
--- /dev/null
@@ -0,0 +1 @@
+Check if the comments in the forward-zones-file are indeed ignored
diff --git a/regression-tests.recursor/comments-in-forward-zones-file/expected_result b/regression-tests.recursor/comments-in-forward-zones-file/expected_result
new file mode 100644 (file)
index 0000000..59ff5a9
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "id": "forward-zones-test2.non-existing.powerdns.com.",
+  "url": "/api/v1/servers/localhost/zones/forward-zones-test2.non-existing.powerdns.com.",
+  "name": "forward-zones-test2.non-existing.powerdns.com.",
+  "kind": "Forwarded",
+  "servers": [
+    "8.8.8.8:53"
+  ],
+  "recursion_desired": false
+}
+{
+  "id": "forward-zones-test.non-existing.powerdns.com.",
+  "url": "/api/v1/servers/localhost/zones/forward-zones-test.non-existing.powerdns.com.",
+  "name": "forward-zones-test.non-existing.powerdns.com.",
+  "kind": "Forwarded",
+  "servers": [
+    "8.8.8.8:53"
+  ],
+  "recursion_desired": false
+}
index 3e5b72d65551ee67dd7f2a94f9f8e7ccba0ddf6c..c309aecbe863be1001761e281e4d60c1344feef6 100755 (executable)
@@ -450,7 +450,18 @@ EOF
     ln -s ../run-auth $dir/run
 done
 
+cat > recursor-service/forward-zones-file << EOF
+# Some comment that should be ignored
+forward-zones-test.non-existing.powerdns.com=8.8.8.8
+forward-zones-test2.non-existing.powerdns.com=8.8.8.8# This comment should be ignored as well
+EOF
+
 cat > recursor-service/recursor.conf <<EOF
+webserver=yes
+api-key=secret
+api-readonly=yes
+forward-zones-file=$(pwd)/recursor-service/forward-zones-file
+
 socket-dir=$(pwd)/recursor-serviceS
 auth-zones=global.box.answer-cname-in-local.example.net=$(pwd)/recursor-service/global.box.answer-cname-in-local.example.net.zone,auth-zone.example.net=$(pwd)/recursor-service/auth-zone.example.net.zone,another-auth-zone.example.net=$(pwd)/recursor-service/another-auth-zone.example.net.zone