From: Peter van Dijk Date: Thu, 19 Jan 2012 12:36:32 +0000 (+0000) Subject: more testing/xml updates X-Git-Tag: auth-3.1-rc1~173 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dbdd1e7685706282b3c73bf2e5988108257d9b9;p=pdns more testing/xml updates git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2353 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/no-dnssec.schema.mysql.sql b/pdns/no-dnssec.schema.mysql.sql new file mode 100644 index 000000000..f534d46a1 --- /dev/null +++ b/pdns/no-dnssec.schema.mysql.sql @@ -0,0 +1,34 @@ +create table domains ( + id INT auto_increment, + name VARCHAR(255) NOT NULL, + master VARCHAR(128) DEFAULT NULL, + last_check INT DEFAULT NULL, + type VARCHAR(6) NOT NULL, + notified_serial INT DEFAULT NULL, + account VARCHAR(40) DEFAULT NULL, + primary key (id) +) Engine=InnoDB; + +CREATE UNIQUE INDEX name_index ON domains(name); + +CREATE TABLE records ( + id INT auto_increment, + domain_id INT DEFAULT NULL, + name VARCHAR(255) DEFAULT NULL, + type VARCHAR(10) DEFAULT NULL, + content VARCHAR(4096) DEFAULT NULL, + ttl INT DEFAULT NULL, + prio INT DEFAULT NULL, + change_date INT DEFAULT NULL, + primary key(id) +) Engine=InnoDB; + +CREATE INDEX rec_name_index ON records(name); +CREATE INDEX nametype_index ON records(name,type); +CREATE INDEX domain_id ON records(domain_id); + +create table supermasters ( + ip VARCHAR(25) NOT NULL, + nameserver VARCHAR(255) NOT NULL, + account VARCHAR(40) DEFAULT NULL +) Engine=InnoDB; diff --git a/regression-tests/00dnssec-grabkeys/command b/regression-tests/00dnssec-grabkeys/command index 5e7e12451..45b43f889 100755 --- a/regression-tests/00dnssec-grabkeys/command +++ b/regression-tests/00dnssec-grabkeys/command @@ -1,4 +1,5 @@ -#!/bin/sh +#!/bin/sh -e +set pipefail rm -f trustedkeys for zone in $(grep zone named.conf | cut -f2 -d\") do diff --git a/regression-tests/runtests b/regression-tests/runtests index b0f643814..c94b1a40b 100755 --- a/regression-tests/runtests +++ b/regression-tests/runtests @@ -9,6 +9,8 @@ passed=0 failed=0 skipped=0 +touch passed_tests failed_tests skipped_tests + for a in $(find . -type d | grep -v ^.$ | sed s:^./:: | grep -v .svn | grep -v ^confdir | LC_ALL=C sort) do echo "$a: " @@ -54,5 +56,3 @@ then echo there appear to have been $(grep -c '^-- MARK --' dnssec-validation-failures) DNSSEC validation failures. echo Please see the 'dnssec-validation-failures' file for details. fi - -./toxml > testresults.xml diff --git a/regression-tests/start-test-stop b/regression-tests/start-test-stop index b5e62b8a4..1e71ffe89 100755 --- a/regression-tests/start-test-stop +++ b/regression-tests/start-test-stop @@ -1,12 +1,107 @@ #!/bin/sh -ex + +tosql () +{ + make -C ../pdns/backends/bind zone2sql > /dev/null + ../pdns/backends/bind/zone2sql --transactions --$1 --named-conf=./named.conf + +} + port=$1 [ -z "$port" ] && port=5300 -./bind-gsqlite3-setup -../pdns/pdns_server --daemon=no --local-port=5300 --socket-dir=./ \ ---no-shuffle --launch=bind,gsqlite3 --bind-config=./named.conf \ ---gsqlite3-database=./powerdns.sqlite3 --gsqlite3-dnssec \ ---fancy-records --query-logging --send-root-referral --loglevel=9 \ ---cache-ttl=0 --no-config & +context=$2 +[ -z "$context" ] && context=bind-gsqlite3 + +case $context in + bind) + ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \ + --no-shuffle --launch=bind --bind-config=./named.conf \ + --fancy-records --query-logging --send-root-referral --loglevel=9 \ + --cache-ttl=0 --no-config & + ;; + bind-gsqlite3) + ./bind-gsqlite3-setup + ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \ + --no-shuffle --launch=bind,gsqlite3 --bind-config=./named.conf \ + --gsqlite3-database=./powerdns.sqlite3 --gsqlite3-dnssec \ + --fancy-records --query-logging --send-root-referral --loglevel=9 \ + --cache-ttl=0 --no-config & + ;; + gmysql-nodnssec) + [ -z "$GMYSQLDB" ] && GMYSQLDB=pdnstest + [ -z "$GMYSQLUSER" ] && GMYSQLUSER=root + [ -z "$GMYSQLHOST" ] && GMYSQLHOST=localhost + [ -z "$GMYSQLPASSWD" ] && GMYSQLPASSWD='' + + mysqladmin --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" --force drop "$GMYSQLDB" \ + || echo ignoring mysqladmin drop failure + mysqladmin --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" create "$GMYSQLDB" + mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \ + "$GMYSQLDB" < ../pdns/no-dnssec.schema.mysql.sql + + tosql gmysql | mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \ + "$GMYSQLDB" + + ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \ + --no-shuffle --launch=gmysql \ + --fancy-records --query-logging --send-root-referral --loglevel=9 \ + --cache-ttl=0 --no-config \ + --gmysql-dbname="$GMYSQLDB" \ + --gmysql-user="$GMYSQLUSER" \ + --gmysql-host="$GMYSQLHOST" \ + --gmysql-password="$GMYSQLPASS" & + ;; + gmysql) + [ -z "$GMYSQLDB" ] && GMYSQLDB=pdnstest + [ -z "$GMYSQLUSER" ] && GMYSQLUSER=root + [ -z "$GMYSQLHOST" ] && GMYSQLHOST=localhost + [ -z "$GMYSQLPASSWD" ] && GMYSQLPASSWD='' + + mysqladmin --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" --force drop "$GMYSQLDB" \ + || echo ignoring mysqladmin drop failure + mysqladmin --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" create "$GMYSQLDB" + mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \ + "$GMYSQLDB" < ../pdns/no-dnssec.schema.mysql.sql + mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \ + "$GMYSQLDB" < ../pdns/dnssec.schema.mysql.sql + + tosql gmysql | mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \ + "$GMYSQLDB" + + cat > pdns-gmysql.conf << __EOF__ +launch=gmysql +gmysql-dbname=$GMYSQLDB +gmysql-user=$GMYSQLUSER +gmysql-host=$GMYSQLHOST +gmysql-password=$GMYSQLPASS +gmysql-dnssec +__EOF__ + for zone in $(grep zone named.conf | cut -f2 -d\") + do + ../pdns/pdnssec --config-dir=. --config-name=gmysql secure-zone $zone 2>&1 + done + + ../pdns/pdns_server --daemon=no --local-port=$port --socket-dir=./ \ + --no-shuffle --launch=gmysql --gmysql-dnssec \ + --fancy-records --query-logging --send-root-referral --loglevel=9 \ + --cache-ttl=0 --no-config \ + --gmysql-dbname="$GMYSQLDB" \ + --gmysql-user="$GMYSQLUSER" \ + --gmysql-host="$GMYSQLHOST" \ + --gmysql-password="$GMYSQLPASS" & + ;; + *) + echo unknown context $context + : > passed_tests + echo 'unknown-context' > failed_tests + ./toxml $context + exit 1 +esac + export port -nameserver=127.0.0.1 ./runtests + +## TODO: give pdns a few seconds to startup or fail, then check if it did not fail +## TODO: give sdig a timeout +nameserver=127.0.0.1 ./runtests $context kill $(cat pdns.pid) +./toxml $context diff --git a/regression-tests/toxml b/regression-tests/toxml index 60c45f866..86a768e24 100755 --- a/regression-tests/toxml +++ b/regression-tests/toxml @@ -1,12 +1,19 @@ #!/bin/sh +CONTEXT=$1 +[ -z "$context" ] || CONTEXT="global" +exec > testresults-${CONTEXT}.xml echo '' NUMTESTS=$(cat failed_tests passed_tests | wc -l) NUMFAILED=$(cat failed_tests | wc -l) -echo '' +echo '' for t in $(cat failed_tests) do - echo ' ' + echo ' ' echo ' ' echo ' ' done +for t in $(cat passed_tests) +do + echo ' ' +done echo ''