From: Kees Monshouwer Date: Mon, 14 Apr 2014 06:33:21 +0000 (+0200) Subject: add postgress-slave mode to regression tests X-Git-Tag: rec-3.6.0-rc1~61^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33a2b18da7ed870683785d9dde0ff6978f0d0942;p=thirdparty%2Fpdns.git add postgress-slave mode to regression tests --- diff --git a/regression-tests/backends/common b/regression-tests/backends/common index 1a9a907fba..e420b87bbc 100644 --- a/regression-tests/backends/common +++ b/regression-tests/backends/common @@ -80,6 +80,10 @@ start_slave () source ./backends/goracle-slave ;; + gpgsql*) + source ./backends/gpgsql-slave + ;; + gsqlite3*) source ./backends/gsqlite3-slave ;; diff --git a/regression-tests/backends/gpgsql-slave b/regression-tests/backends/gpgsql-slave new file mode 100644 index 0000000000..5e877655a3 --- /dev/null +++ b/regression-tests/backends/gpgsql-slave @@ -0,0 +1,53 @@ + context=${context}-presigned-gpgql + [ -z "$GPGSQ2LDB" ] && GPGSQL2DB=pdnstest2 + [ -z "$GPGSQL2USER" ] && GPGSQL2USER=$(whoami) + + dropdb --user="$GPGSQL2USER" "$GPGSQL2DB" || echo ignoring mysqladmin drop failure + createdb --user="$GPGSQL2USER" "$GPGSQL2DB" || echo ignoring mysqladmin drop failure + psql --user="$GPGSQL2USER" "$GPGSQL2DB" < ../modules/gpgsqlbackend/schema.pgsql.sql + + cat > pdns-gpgsql2.conf << __EOF__ +launch=gpgsql +gpgsql-dbname=$GPGSQL2DB +gpgsql-user=$GPGSQL2USER +gpgsql-dnssec +__EOF__ + + for zone in $(grep 'zone ' named.conf | cut -f2 -d\" | tac) + do + psql --user="$GPGSQL2USER" "$GPGSQL2DB" \ + -c "INSERT INTO domains (name, type, master) VALUES('$zone','SLAVE','127.0.0.1:$port')" + done + + ../pdns/pdnssec --config-dir=. --config-name=gpgsql2 import-tsig-key test $ALGORITHM $KEY + ../pdns/pdnssec --config-dir=. --config-name=gpgsql2 activate-tsig-key tsig.com test master + if [[ $skipreasons != *nolua* ]] + then + ../pdns/pdnssec --config-dir=. --config-name=gpgsql2 set-meta stest.com AXFR-SOURCE 127.0.0.2 + fi + + port=$((port+100)) + + $RUNWRAPPER $PDNS2 --daemon=no --local-port=$port --config-dir=. \ + --config-name=gpgsql2 --socket-dir=./ --no-shuffle \ + --send-root-referral --slave --retrieval-threads=4 \ + --slave-cycle-interval=300 --experimental-dname-processing & + + echo 'waiting for zones to be slaved' + loopcount=0 + while [ $loopcount -lt 30 ] + do + sleep 5 + todo=$(psql --user="$GPGSQL2USER" "$GPGSQL2DB" \ + -t -c 'SELECT COUNT(id) FROM domains WHERE last_check IS NULL') + if [ $todo = 0 ] + then + break + fi + let loopcount=loopcount+1 + done + if [ $todo -ne 0 ] + then + echo "AXFR FAILED" >> failed_tests + exit + fi