]> granicus.if.org Git - pdns/commitdiff
add hybrid mode regression tests
authorKees Monshouwer <mind04@monshouwer.org>
Sun, 29 Jun 2014 10:56:15 +0000 (12:56 +0200)
committermind04 <mind04@monshouwer.org>
Sun, 29 Jun 2014 11:04:06 +0000 (13:04 +0200)
.travis.yml
regression-tests/backends/bind-master
regression-tests/pdns.conf [deleted file]
regression-tests/tests/bind-add-zone/command

index eee49816eefa5482670cd47bcd545334bce60c70..02f1e70a821c8cd4d71d0f67ba888f8c8faa1650 100644 (file)
@@ -64,6 +64,7 @@ script:
  - ./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-both
  - ./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-optout-both
  - ./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-narrow
+ - ./timestamp ./start-test-stop 5300 bind-hybrid-nsec3
  - ./timestamp ./start-test-stop 5300 gmysql-nodnssec-both
  - ./timestamp ./start-test-stop 5300 gmysql-both
  - ./timestamp ./start-test-stop 5300 gmysql-nsec3-both
index 172edc82bb9be4ab6ad42b783fe52b1f274c4685..568b25ad0da45c4d2ccc221b57425cca0e6f425c 100644 (file)
@@ -1,32 +1,72 @@
 case $context in
        bind)
-               $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \
-                       --no-shuffle --launch=bind --bind-config=./named.conf \
+               cat > pdns-bind.conf << __EOF__
+launch=bind
+bind-config=./named.conf
+bind-ignore-broken-records=yes
+__EOF__
+
+               $RUNWRAPPER $PDNS --daemon=no --local-port=$port --config-dir=. \
+                       --config-name=bind --socket-dir=./ --no-shuffle \
                        --send-root-referral \
-                       --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
-                       --cache-ttl=$cachettl --no-config --experimental-dname-processing \
-                       --bind-ignore-broken-records=yes --disable-axfr-rectify=yes  &
+                       --cache-ttl=$cachettl --experimental-dname-processing \
+                       --disable-axfr-rectify=yes &
                skipreasons="nodnssec nodyndns nometa"
-               bindwait
+               bindwait bind
                ;;
 
-       bind-dnssec | bind-dnssec-nsec3 | bind-dnssec-nsec3-optout | bind-dnssec-nsec3-narrow)
+       bind-dnssec | bind-dnssec-nsec3 | bind-hybrid-nsec3 | bind-dnssec-nsec3-optout | bind-dnssec-nsec3-narrow)
                rm -f dnssec.sqlite3
-               ../pdns/pdnssec --config-dir=. create-bind-db dnssec.sqlite3
+               cat > pdns-bind.conf << __EOF__
+launch=bind
+bind-config=./named.conf
+bind-ignore-broken-records=yes
+__EOF__
+               if [ $context = bind-hybrid-nsec3 ]
+               then
+                       [ -z "$GMYSQLDB" ] && GMYSQLDB=pdnstest
+                       [ -z "$GMYSQLUSER" ] && GMYSQLUSER=root
+                       [ -z "$GMYSQLHOST" ] && GMYSQLHOST=localhost
+                       [ -z "$GMYSQLPASSWD" ] && GMYSQLPASSWD=''
+
+                       mysqladmin --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" --force drop "$GMYSQLDB" \
+                               || echo ignoring mysqladmin drop failure
+                       mysqladmin --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" create "$GMYSQLDB"
+                       mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
+                               "$GMYSQLDB" < ../modules/gmysqlbackend/schema.mysql.sql
+
+               cat >> pdns-bind.conf << __EOF__
+bind-hybrid
+launch+=gmysql
+gmysql-dbname=$GMYSQLDB
+gmysql-user=$GMYSQLUSER
+gmysql-host=$GMYSQLHOST
+gmysql-password=$GMYSQLPASSWD
+gmysql-dnssec
+__EOF__
+               else
+                       echo "bind-dnssec-db=./dnssec.sqlite3" >> pdns-bind.conf
+                       ../pdns/pdnssec --config-dir=. --config-name=bind create-bind-db dnssec.sqlite3
+               fi
 
                for zone in $(grep 'zone ' named.conf  | cut -f2 -d\")
                do
-                       securezone $zone
-                       if [ $context = bind-dnssec-nsec3 ] || [ $context = bind-dnssec-nsec3-optout ]
+                       if [ $context = bind-hybrid-nsec3 ]
+                       then
+                               mysql --user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
+                                       "$GMYSQLDB" -e "INSERT INTO domains (name, type, master) VALUES('$zone','SLAVE','127.0.0.1:$port')"
+                       fi
+                       securezone $zone bind
+                       if [ $context = bind-dnssec-nsec3 ] || [ $context = bind-dnssec-nsec3-optout ] || [ $context = bind-hybrid-nsec3 ]
                        then
-                               ../pdns/pdnssec --config-dir=. set-nsec3 $zone "1 $optout 1 abcd" 2>&1
+                               ../pdns/pdnssec --config-dir=. --config-name=bind set-nsec3 $zone "1 $optout 1 abcd" 2>&1
                        elif [ $context = bind-dnssec-nsec3-narrow ]
                        then
-                               ../pdns/pdnssec --config-dir=. set-nsec3 $zone '1 1 1 abcd' narrow 2>&1
+                               ../pdns/pdnssec --config-dir=. --config-name=bind set-nsec3 $zone '1 1 1 abcd' narrow 2>&1
                        fi
                done
 
-               if [ $context = bind-dnssec-nsec3 ]
+               if [ $context = bind-dnssec-nsec3 ] || [ $context = bind-hybrid-nsec3 ]
                then
                        extracontexts="bind dnssec nsec3"
                        skipreasons="nsec3 nodyndns"
@@ -43,17 +83,16 @@ case $context in
                        skipreasons="nodyndns"
                fi
 
-               ../pdns/pdnssec --config-dir=. import-tsig-key test $ALGORITHM $KEY
-               ../pdns/pdnssec --config-dir=. activate-tsig-key tsig.com test master
+               ../pdns/pdnssec --config-dir=. --config-name=bind import-tsig-key test $ALGORITHM $KEY
+               ../pdns/pdnssec --config-dir=. --config-name=bind activate-tsig-key tsig.com test master
 
-               $RUNWRAPPER $PDNS --daemon=no --local-port=$port --socket-dir=./ \
-                       --no-shuffle --launch=bind --bind-config=./named.conf \
-                       --bind-dnssec-db=./dnssec.sqlite3 \
+               $RUNWRAPPER $PDNS --daemon=no --local-port=$port --config-dir=. \
+                       --config-name=bind --socket-dir=./ --no-shuffle \
                        --send-root-referral \
-                       --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes --direct-dnskey=yes \
-                       --cache-ttl=$cachettl --no-config --experimental-dname-processing \
-                       --bind-ignore-broken-records=yes --disable-axfr-rectify=yes $lua_prequery &
-               bindwait
+                       --cache-ttl=$cachettl --experimental-dname-processing \
+                       --disable-axfr-rectify=yes $lua_prequery &
+
+               bindwait bind
                ;;
 
        *)
diff --git a/regression-tests/pdns.conf b/regression-tests/pdns.conf
deleted file mode 100644 (file)
index 4f7e1b9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-socket-dir=./
-launch=bind
-bind-dnssec-db=./dnssec.sqlite3
-bind-config=./named.conf
-bind-ignore-broken-records=yes
index fde5aa88e60680f34e7aee813e17e47eebbf8a13..d4a84686b3e73d7cd6e3523a037288fb1ef5bda8 100755 (executable)
@@ -6,10 +6,10 @@ fi
 
 cleandig ns1.addzone.com A
 cleandig ns1.test.com A
-../pdns/pdns_control --config-dir=. bind-add-zone addzone.com zones/addzone.com
-../pdns/pdns_control --config-dir=. purge addzone.com
+../pdns/pdns_control --config-name=bind --socket-dir=. --no-config bind-add-zone addzone.com zones/addzone.com
+../pdns/pdns_control --config-name=bind --socket-dir=. --no-config purge addzone.com
 sleep 1
-../pdns/pdns_control --config-dir=. bind-add-zone addzone.com zones/addzone.com
+../pdns/pdns_control --config-name=bind --socket-dir=. --no-config bind-add-zone addzone.com zones/addzone.com
 sleep 1
 cleandig ns1.addzone.com A
 sleep 1