From 382db5fb5baa7eb0a1aa8e71fef8ec2dfe872904 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sat, 15 Jun 2013 21:22:39 +0300 Subject: [PATCH] Regression tests --- modules/gsqlite3backend/gsqlite3backend.cc | 2 +- regression-tests/start-test-stop | 2 ++ regression-tests/tsig-axfr/command | 5 +++++ regression-tests/tsig-axfr/description | 1 + regression-tests/tsig-axfr/expected_result | 4 ++++ regression-tests/tsig-axfr/skip.narrow | 0 regression-tests/tsig-axfr/skip.nodnssec | 0 regression-tests/tsig-axfr/skip.presigned | 0 8 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 regression-tests/tsig-axfr/command create mode 100644 regression-tests/tsig-axfr/description create mode 100644 regression-tests/tsig-axfr/expected_result create mode 100644 regression-tests/tsig-axfr/skip.narrow create mode 100644 regression-tests/tsig-axfr/skip.nodnssec create mode 100644 regression-tests/tsig-axfr/skip.presigned diff --git a/modules/gsqlite3backend/gsqlite3backend.cc b/modules/gsqlite3backend/gsqlite3backend.cc index 2d6d2df9fe..8583ff25be 100644 --- a/modules/gsqlite3backend/gsqlite3backend.cc +++ b/modules/gsqlite3backend/gsqlite3backend.cc @@ -131,7 +131,7 @@ public: declare(suffix,"deactivate-domain-key-query","", "update cryptokeys set active=0 where domain_id=(select id from domains where name='%s') and cryptokeys.id=%d"); declare(suffix,"remove-domain-key-query","", "delete from cryptokeys where domain_id=(select id from domains where name='%s') and cryptokeys.id=%d"); declare(suffix,"get-tsig-key-query","", "select algorithm, secret from tsigkeys where name='%s'"); - declare(suffix,"set-tsig-key-query","", "insert or replace into tsigkeys (name,algorithm,secret) values('%s','%s','%s')"); + declare(suffix,"set-tsig-key-query","", "replace into tsigkeys (name,algorithm,secret) values('%s','%s','%s')"); declare(suffix,"delete-tsig-key-query","", "delete from tsigkeys where name='%s'"); declare(suffix,"get-tsig-keys-query","", "select name,algorithm, secret from tsigkeys"); diff --git a/regression-tests/start-test-stop b/regression-tests/start-test-stop index 759c8a1346..dd96a2114f 100755 --- a/regression-tests/start-test-stop +++ b/regression-tests/start-test-stop @@ -176,6 +176,8 @@ case $context in bind-dnssec | bind-dnssec-nsec3 | bind-dnssec-nsec3-optout | bind-dnssec-nsec3-narrow) rm -f dnssec.sqlite3 ../pdns/pdnssec --config-dir=. create-bind-db dnssec.sqlite3 + ../pdns/pdnssec --config-dir=. import-tsig-key test hmac-md5 'kp4/24gyYsEzbuTVJRUMoqGFmN3LYgVDzJ/3oRSP7ys=' + for zone in $(grep zone named.conf | cut -f2 -d\") do securezone $zone diff --git a/regression-tests/tsig-axfr/command b/regression-tests/tsig-axfr/command new file mode 100755 index 0000000000..6cff30fa87 --- /dev/null +++ b/regression-tests/tsig-axfr/command @@ -0,0 +1,5 @@ +#!/bin/sh + +../pdns/pdnssec --config-dir=. enable-tsig-key minimal.com test master +dig -t axfr minimal.com @$nameserver -p $port -y 'test:kp4/24gyYsEzbuTVJRUMoqGFmN3LYgVDzJ/3oRSP7ys=' | grep 'IN\s*SOA' +../pdns/pdnssec --config-dir=. disable-tsig-key minimal.com test master diff --git a/regression-tests/tsig-axfr/description b/regression-tests/tsig-axfr/description new file mode 100644 index 0000000000..019b9ca1f7 --- /dev/null +++ b/regression-tests/tsig-axfr/description @@ -0,0 +1 @@ +Basic TSIG axfr test diff --git a/regression-tests/tsig-axfr/expected_result b/regression-tests/tsig-axfr/expected_result new file mode 100644 index 0000000000..154dc894d8 --- /dev/null +++ b/regression-tests/tsig-axfr/expected_result @@ -0,0 +1,4 @@ +Enabled TSIG key test for minimal.com +minimal.com. 120 IN SOA ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400 +minimal.com. 120 IN SOA ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400 +Disabled TSIG key test for minimal.com diff --git a/regression-tests/tsig-axfr/skip.narrow b/regression-tests/tsig-axfr/skip.narrow new file mode 100644 index 0000000000..e69de29bb2 diff --git a/regression-tests/tsig-axfr/skip.nodnssec b/regression-tests/tsig-axfr/skip.nodnssec new file mode 100644 index 0000000000..e69de29bb2 diff --git a/regression-tests/tsig-axfr/skip.presigned b/regression-tests/tsig-axfr/skip.presigned new file mode 100644 index 0000000000..e69de29bb2 -- 2.47.3