]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests/backends/godbc_mssql-slave
updated KSK and ZSK Rollover procedures, small fixes in Algorithm Rollover procedure
[thirdparty/pdns.git] / regression-tests / backends / godbc_mssql-slave
1 context=${context}-presigned-godbc
2 ISQL="isql $GODBC_MSSQL2_DSN $GODBC_MSSQL2_USERNAME $GODBC_MSSQL2_PASSWORD"
3 # Drop _ALL_ the tables!
4 for table in `echo "SELECT name FROM sysobjects WHERE OBJECTPROPERTY(id, N'IsUserTable') = 1" | $ISQL -b -d.`; do
5 echo "drop table $table" | $ISQL -b
6 done
7 $ISQL < ../modules/godbcbackend/schema.mssql.sql
8 cat > pdns-godbc2.conf << __EOF__
9 module-dir=./modules
10 launch=godbc
11 godbc-datasource=$GODBC_MSSQL2_DSN
12 godbc-username=$GODBC_MSSQL2_USERNAME
13 godbc-password=$GODBC_MSSQL2_PASSWORD
14 __EOF__
15
16 for zone in $(grep 'zone ' named.conf | cut -f2 -d\" | tac)
17 do
18 echo "INSERT INTO domains (name, type, master) VALUES('$zone','SLAVE','127.0.0.1:$port');" | $ISQL -b
19 if [ "$zone" = "tsig.com" ]; then
20 ../pdns/pdnssec --config-dir=. --config-name=godbc2 import-tsig-key test $ALGORITHM $KEY
21 ../pdns/pdnssec --config-dir=. --config-name=godbc2 activate-tsig-key tsig.com test slave
22 fi
23 if [ "$zone" = "stest.com" ]; then
24 if [[ $skipreasons != *nolua* ]]; then
25 $PDNSUTIL --config-dir=. --config-name=godbc2 set-meta stest.com AXFR-SOURCE 127.0.0.2
26 fi
27 fi
28 done
29
30 port=$((port+100))
31
32 $RUNWRAPPER $PDNS2 --daemon=no --local-port=$port --config-dir=. \
33 --config-name=godbc2 --socket-dir=./ --no-shuffle \
34 --slave --retrieval-threads=4 \
35 --slave-cycle-interval=300 --dname-processing &
36
37 echo 'waiting for zones to be slaved'
38 set +e
39 loopcount=0
40 while [ $loopcount -lt 30 ]
41 do
42 sleep 5
43 todo=$(echo "SELECT COUNT(id) FROM domains WHERE last_check IS NULL" | $ISQL)
44 if [ $? -eq 0 ]
45 then
46 if [ $todo = 0 ]
47 then
48 break
49 fi
50 fi
51 let loopcount=loopcount+1
52 done
53 if [ $todo -ne 0 ]
54 then
55 echo "AXFR FAILED" >> failed_tests
56 exit
57 fi
58 set -e