]> granicus.if.org Git - pdns/commitdiff
add oracle backend-slave to regression tests
authorKees Monshouwer <mind04@monshouwer.org>
Wed, 22 Jan 2014 11:28:18 +0000 (12:28 +0100)
committermind04 <mind04@monshouwer.org>
Wed, 22 Jan 2014 13:02:50 +0000 (14:02 +0100)
regression-tests/backends/common
regression-tests/backends/oracle-slave [new file with mode: 0644]

index bf9267a7d4051e2f6e709a8b176797349ee63efb..1a9a907fba485d816446c7bae08a2da0153f6e30 100644 (file)
@@ -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 (file)
index 0000000..53895a8
--- /dev/null
@@ -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