--- /dev/null
+ 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