From: Kees Monshouwer Date: Wed, 22 Jan 2014 11:28:18 +0000 (+0100) Subject: add oracle backend-slave to regression tests X-Git-Tag: rec-3.6.0-rc1~229^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=223c356a4e62c99531e9d70f5f7cffb9b9037a1d;p=pdns add oracle backend-slave to regression tests --- diff --git a/regression-tests/backends/common b/regression-tests/backends/common index bf9267a7d..1a9a907fb 100644 --- a/regression-tests/backends/common +++ b/regression-tests/backends/common @@ -84,6 +84,9 @@ start_slave () source ./backends/gsqlite3-slave ;; + oracle*) + source ./backends/oracle-slave + ;; ext-bind*) source ./ext/bind-slave diff --git a/regression-tests/backends/oracle-slave b/regression-tests/backends/oracle-slave new file mode 100644 index 000000000..53895a882 --- /dev/null +++ b/regression-tests/backends/oracle-slave @@ -0,0 +1,78 @@ + context=${context}-presigned + [ -z "$ORACLE2USER" ] && ORACLE2USER=pdns + [ -z "$ORACLE2PASSWD" ] && ORACLE2PASSWD=pdns + + echo "START ../modules/oraclebackend/dropschema;" | sqlplus -S $ORACLE2USER/$ORACLE2PASSWD@xe > oracle2.log + echo "START ../modules/oraclebackend/schema;" | sqlplus -S $ORACLE2USER/$ORACLE2PASSWD@xe >> oracle2.log + + cat > pdns-oracle2.conf << __EOF__ +launch=oracle +oracle-home=$ORACLE_HOME +oracle-sid=$ORACLE_SID +oracle-nls-lang=$NLS_LANG + +oracle-pool-database=xe +oracle-pool-username=$ORACLE2USER +oracle-pool-password=$ORACLE2PASSWD +oracle-master-database=xe +oracle-master-username=$ORACLE2USER +oracle-master-password=$ORACLE2PASSWD +oracle-dnssec +__EOF__ + + for zone in $(grep 'zone ' named.conf | cut -f2 -d\" | tac) + do + echo "INSERT ALL INTO zones (id, name, type) VALUES (zones_id_seq.nextval, name, 'SLAVE') INTO zonemasters (zone_id, master) VALUES (zones_id_seq.nextval, master) SELECT '$zone' AS name, '127.0.0.1:$port' AS master FROM dual;" | sqlplus -S $ORACLE2USER/$ORACLE2PASSWD@xe >> oracle2.log + done + + set +e + echo $skipreasons | grep -q nodnssec + if [ $? -ne 0 ] + then + ../pdns/pdnssec --config-dir=. --config-name=oracle2 import-tsig-key test $ALGORITHM $KEY + ../pdns/pdnssec --config-dir=. --config-name=oracle2 activate-tsig-key tsig.com test master + echo $skipreasons | grep -q nolua + if [ $? -ne 0 ] + then + ../pdns/pdnssec --config-dir=. --config-name=oracle2 set-meta stest.com AXFR-SOURCE 127.0.0.2 + fi + fi + set -e + + port=$((port+100)) + + $RUNWRAPPER $PDNS2 --daemon=no --local-port=$port --config-dir=. \ + --config-name=goracle2 --socket-dir=./ --no-shuffle \ + --send-root-referral --slave --retrieval-threads=4 \ + --slave-cycle-interval=300 --config-name=oracle2 --query-logging & + echo 'waiting for zones to be slaved' + + loopcount=0 + while [ $loopcount -lt 40 ] + do + sleep 5 + todo=$(sqlplus -S $ORACLE2USER/$ORACLE2PASSWD@xe << __EOF__ +set pagesize 0 feedback off verify off heading off echo off; +SELECT COUNT(id) FROM zones WHERE last_check IS NULL; +exit; +__EOF__ +) + if [ $todo = 0 ] + then + break + fi + let loopcount=loopcount+1 + done + if [ $todo -ne 0 ] + then + echo "AXFR FAILED" >> failed_tests + fi + + if [[ $extracontexts = *nsec3* ]] + then + skipreasons="$skipreasons oracle-nsec3" + elif [[ $extracontexts = *dnssec* ]] + then + skipreasons="$skipreasons oracle-nsec" + fi + skipreasons="$skipreasons noent" # TODO add ent support to oracle backend