3 PDNS
=${PDNS:-../pdns/pdns_server}
4 PDNS2
=${PDNS2:-../pdns/pdns_server}
8 make -C ..
/pdns
/backends
/bind zone2sql
> /dev
/null
9 ..
/pdns
/backends
/bind
/zone2sql
--transactions --$1 --named-conf=.
/named.conf
17 domcount
=$
(grep -c zone named.conf
)
18 if [ ! -x ..
/pdns
/pdns_control
]; then
19 echo "No pdns_control found"
24 while [ $loopcount -lt 20 ]; do
26 done=$
( (..
/pdns
/pdns_control
--config-name=$configname --socket-dir=.
--no-config bind-domain-status || true
) |
grep -c 'parsed into memory' || true
)
27 if [ $done = $domcount ]; then
30 let loopcount
=loopcount
+1
33 if [ $done != $domcount ]; then
34 echo "Domain parsing failed" >> failed_tests
42 if [ -n "$configname" ]
44 configname
="--config-name=$configname"
46 if [ "${zone: 0:16}" = "secure-delegated" ]
48 ..
/pdns
/pdnssec
--config-dir=.
$configname import-zone-key
$zone $zone.key ksk
2>&1
49 ..
/pdns
/pdnssec
--config-dir=.
$configname add-zone-key
$zone 1024 zsk
2>&1
50 keyid
=`../pdns/pdnssec --config-dir=. $configname show-zone $zone | grep ZSK | cut -d' ' -f3`
51 ..
/pdns
/pdnssec
--config-dir=.
$configname activate-zone-key
$zone $keyid 2>&1
52 ..
/pdns
/pdnssec
--config-dir=.
$configname add-zone-key
$zone 1024 zsk
2>&1
53 ..
/pdns
/pdnssec
--config-dir=.
$configname rectify-zone
$zone 2>&1
55 ..
/pdns
/pdnssec
--config-dir=.
$configname secure-zone
$zone 2>&1
63 while [ $loopcount -lt 5 ]; do
65 pids
=$
(cat pdns
*.pid
2>/dev
/null
)
66 if [ ! -z "$pids" ]; then
67 kill -0 $pids >/dev
/null
2>&1
73 let loopcount
=loopcount
+1
75 echo "PowerDNS did not start"
79 if [ ! -x $PDNS ]; then
80 echo "$PDNS is not executable binary"
84 if [ ! -x $PDNS2 ]; then
85 echo "$PDNS2 is not executable binary"
90 [ -z "$port" ] && port
=5300
92 [ -z "$context" ] && context
=bind-dnssec
94 [ -z "$wait" ] && wait=nowait
96 [ -z "$cachettl" ] && cachettl
=0
101 if [ "$port" = help ] ||
[ "$context" = help ]
104 grep -v '^#' << '__EOF__'
106 Usage
: .
/start-test-stop
<port
> [<context
>] [wait|nowait
] [<cachettl
>] [<specifictest
>]
109 bind bind-dnssec bind-dnssec-nsec3 bind-dnssec-nsec3-optout bind-dnssec-nsec3-narrow
110 gmysql-nodnssec gmysql gmysql-nsec3 gmysql-nsec3-optout gmysql-nsec3-narrow
111 gpgsql-nodnssec gpgsql gpgsql-nsec3
112 gsqlite3-nodnssec gsqlite3 gsqlite3-nsec3
116 remotebackend-pipe remotebackend-unix remotebackend-http
117 remotebackend-pipe-dnssec remotebackend-unix-dnssec remotebackend-http-dnssec
118 #remotebackend-pipe-nsec3 remotebackend-unix-nsec3 remotebackend-http-nsec3
119 #remotebackend-pipe-nsec3-narrow remotebackend-unix-nsec3-narrow remotebackend-http-nsec3-narrow
121 * Add
-presigned to any gmysql
test (except narrow
) to
122 test presigned operation
124 * Add
'wait' (literally
) after the context to not
kill
125 pdns_server immediately after testing.
'nowait' will
kill it.
127 * A cachettl can be supplied
if you want to run tests with a
128 ttl setting
set. The default cachettl is
0.
130 * Specifictest can be used to run only one single
test.
135 make -C ..
/pdns sdig nsec3dig ||
exit 1
136 # Copy zones because the test might modify them (well only the dyndns stuff, but let's make this work for others as well)
137 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
139 cp $zone $zone.backup
147 if [ "${context: -10}" = "-presigned" ]
151 context
=${context%-presigned}
156 if [ "${context: -13}" = "-nsec3-optout" ]
164 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
165 --no-shuffle --launch=bind --bind-config=.
/named.conf \
166 --send-root-referral \
167 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
168 --cache-ttl=$cachettl --no-config &
169 skipreasons
="nodnssec nodyndns"
173 bind-dnssec | bind-dnssec-nsec3 | bind-dnssec-nsec3-optout | bind-dnssec-nsec3-narrow
)
175 ..
/pdns
/pdnssec
--config-dir=. create-bind-db dnssec.sqlite3
176 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
179 if [ $context = bind-dnssec-nsec3
] ||
[ $context = bind-dnssec-nsec3-optout
]
181 ..
/pdns
/pdnssec
--config-dir=. set-nsec3
$zone "1 $optout 1 abcd" 2>&1
182 elif [ $context = bind-dnssec-nsec3-narrow
]
184 ..
/pdns
/pdnssec
--config-dir=. set-nsec3
$zone '1 1 1 abcd' narrow
2>&1
188 if [ $context = bind-dnssec-nsec3
]
190 extracontexts
="bind dnssec nsec3"
191 skipreasons
="nsec3 nodyndns"
192 elif [ $context = bind-dnssec-nsec3-optout
]
194 extracontexts
="bind dnssec nsec3 nsec3-optout"
195 skipreasons
="optout nodyndns"
196 elif [ $context = bind-dnssec-nsec3-narrow
]
198 extracontexts
="bind dnssec narrow"
199 skipreasons
="narrow nodyndns"
201 extracontexts
="bind dnssec"
202 skipreasons
="nodyndns"
205 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
206 --no-shuffle --launch=bind --bind-config=.
/named.conf \
207 --bind-dnssec-db=.
/dnssec.sqlite3 \
208 --send-root-referral \
209 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes --experimental-direct-dnskey=yes \
210 --cache-ttl=$cachettl --no-config &
215 [ -z "$GMYSQLDB" ] && GMYSQLDB
=pdnstest
216 [ -z "$GMYSQLUSER" ] && GMYSQLUSER
=root
217 [ -z "$GMYSQLHOST" ] && GMYSQLHOST
=localhost
218 [ -z "$GMYSQLPASSWD" ] && GMYSQLPASSWD
=''
220 mysqladmin
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" --force drop
"$GMYSQLDB" \
221 ||
echo ignoring mysqladmin drop failure
222 mysqladmin
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" create
"$GMYSQLDB"
223 mysql
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
224 "$GMYSQLDB" < ..
/pdns
/no-dnssec.schema.mysql.sql
226 tosql gmysql | mysql
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
229 cat > pdns-gmysql.conf
<< __EOF__
231 gmysql-dbname=$GMYSQLDB
232 gmysql-user=$GMYSQLUSER
233 gmysql-host=$GMYSQLHOST
234 gmysql-password=$GMYSQLPASSWD
237 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
239 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gmysql rectify-zone
$zone 2>&1
242 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
243 --no-shuffle --launch=gmysql \
244 --master --send-root-referral \
245 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes --experimental-direct-dnskey=yes \
246 --cache-ttl=$cachettl --no-config \
247 --gmysql-dbname="$GMYSQLDB" \
248 --gmysql-user="$GMYSQLUSER" \
249 --gmysql-host="$GMYSQLHOST" \
250 --gmysql-password="$GMYSQLPASSWD" &
254 [ -z "$MYDNSDB" ] && MYDNSDB
=pdnstest
255 [ -z "$MYDNSUSER" ] && MYDNSUSER
=root
256 [ -z "$MYDNSHOST" ] && MYDNSHOST
=localhost
257 [ -z "$MYDNSPASSWD" ] && MYDNSPASSWD
=''
259 mysqladmin
--user="$MYDNSUSER" --password="$MYDNSPASSWD" --host="$MYDNSHOST" --force drop
"$MYDNSDB" \
260 ||
echo ignoring mysqladmin drop failure
261 mysqladmin
--user="$MYDNSUSER" --password="$MYDNSPASSWD" --host="$MYDNSHOST" create
"$MYDNSDB"
262 mysql
--user="$MYDNSUSER" --password="$MYDNSPASSWD" --host="$MYDNSHOST" \
263 "$MYDNSDB" < ..
/modules
/mydnsbackend
/schema.sql
265 tosql mydns |
grep -v 'double\.example\.com' | mysql
--user="$MYDNSUSER" --password="$MYDNSPASSWD" --host="$MYDNSHOST" \
268 cat > pdns-mydns.conf
<< __EOF__
270 mydns-dbname=$MYDNSDB
271 mydns-user=$MYDNSUSER
272 mydns-host=$MYDNSHOST
273 mydns-password=$MYDNSPASSWD
275 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
276 --no-shuffle --launch=mydns \
277 --master --send-root-referral \
278 --cache-ttl=0 --no-config \
279 --mydns-rr-active=no
--mydns-soa-active=no
--mydns-use-minimal-ttl=no \
280 --mydns-dbname="$MYDNSDB" \
281 --mydns-user="$MYDNSUSER" \
282 --mydns-host="$MYDNSHOST" \
283 --mydns-password="$MYDNSPASSWD" &
284 skipreasons
="nodnssec noent nodyndns"
287 gmysql | gmysql-nsec3 | gmysql-nsec3-optout |gmysql-nsec3-narrow
)
288 [ -z "$GMYSQLDB" ] && GMYSQLDB
=pdnstest
289 [ -z "$GMYSQLUSER" ] && GMYSQLUSER
=root
290 [ -z "$GMYSQLHOST" ] && GMYSQLHOST
=localhost
291 [ -z "$GMYSQLPASSWD" ] && GMYSQLPASSWD
=''
293 mysqladmin
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" --force drop
"$GMYSQLDB" \
294 ||
echo ignoring mysqladmin drop failure
295 mysqladmin
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" create
"$GMYSQLDB"
296 mysql
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
297 "$GMYSQLDB" < ..
/pdns
/no-dnssec.schema.mysql.sql
298 mysql
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
299 "$GMYSQLDB" < ..
/pdns
/dnssec.schema.mysql.sql
301 tosql gmysql | mysql
--user="$GMYSQLUSER" --password="$GMYSQLPASSWD" --host="$GMYSQLHOST" \
304 cat > pdns-gmysql.conf
<< __EOF__
306 gmysql-dbname=$GMYSQLDB
307 gmysql-user=$GMYSQLUSER
308 gmysql-host=$GMYSQLHOST
309 gmysql-password=$GMYSQLPASSWD
312 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
314 securezone
$zone gmysql
315 if [ $context = gmysql-nsec3
] ||
[ $context = gmysql-nsec3-optout
]
317 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gmysql set-nsec3
$zone "1 $optout 1 abcd" 2>&1
318 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gmysql rectify-zone
$zone 2>&1
319 elif [ $context = gmysql-nsec3-narrow
]
321 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gmysql set-nsec3
$zone '1 1 1 abcd' narrow
2>&1
322 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gmysql rectify-zone
$zone 2>&1
328 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
329 --no-shuffle --launch+=random
--launch+=gmysql
--gmysql-dnssec \
330 --send-root-referral \
331 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes --experimental-direct-dnskey=yes \
332 --cache-ttl=$cachettl --no-config \
333 --gmysql-dbname="$GMYSQLDB" \
334 --gmysql-user="$GMYSQLUSER" \
335 --gmysql-host="$GMYSQLHOST" \
336 --gmysql-password="$GMYSQLPASSWD" &
337 if [ $context = gmysql-nsec3
]
339 extracontexts
="dnssec nsec3"
341 elif [ $context = gmysql-nsec3-optout
]
343 extracontexts
="dnssec nsec3 nsec3-optout"
345 elif [ $context = gmysql-nsec3-narrow
]
347 extracontexts
="dnssec narrow"
350 extracontexts
="dnssec"
354 gpgsql | gpgsql-nsec3 | gpgsql-nsec3-optout
)
355 [ -z "$GPGSQLDB" ] && GPGSQLDB
=pdnstest
356 [ -z "$GPGSQLUSER" ] && GPGSQLUSER
=$
(whoami
)
358 dropdb
--user="$GPGSQLUSER" "$GPGSQLDB" ||
echo ignoring dropdb failure
359 createdb
--user="$GPGSQLUSER" "$GPGSQLDB" ||
echo ignoring createdb failure
# FIXME
360 psql
--user="$GPGSQLUSER" "$GPGSQLDB" < ..
/pdns
/no-dnssec.schema.pgsql.sql
361 psql
--user="$GPGSQLUSER" "$GPGSQLDB" < ..
/pdns
/dnssec.schema.pgsql.sql
363 tosql gpgsql | psql
--user="$GPGSQLUSER" "$GPGSQLDB" 2>&1 |
uniq -c
365 cat > pdns-gpgsql.conf
<< __EOF__
367 gpgsql-dbname=$GPGSQLDB
368 gpgsql-user=$GPGSQLUSER
371 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
373 securezone
$zone gpgsql
374 if [ $context = gpgsql-nsec3
] ||
[ $context = gpgsql-nsec3-optout
]
376 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gpgsql set-nsec3
$zone "1 $optout 1 abcd" 2>&1
377 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gpgsql rectify-zone
$zone 2>&1
381 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
382 --no-shuffle --launch=gpgsql
--gpgsql-dnssec \
383 --send-root-referral \
384 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
385 --cache-ttl=$cachettl --no-config \
386 --gpgsql-dbname="$GPGSQLDB" \
387 --gpgsql-user="$GPGSQLUSER" &
388 if [ $context = gpgsql-nsec3
]
390 extracontexts
="dnssec nsec3"
391 elif [ $context = gpgsql-nsec3-optout
]
393 extracontexts
="dnssec nsec3 nsec3-optout"
394 elif [ $context = gpgsql-nsec3-narrow
]
396 extracontexts
="dnssec narrow"
398 extracontexts
="dnssec"
403 [ -z "$GPGSQLDB" ] && GPGSQLDB
=pdnstest
404 [ -z "$GPGSQLUSER" ] && GPGSQLUSER
=$
(whoami
)
406 dropdb
--user="$GPGSQLUSER" "$GPGSQLDB" ||
echo ignoring mysqladmin drop failure
407 createdb
--user="$GPGSQLUSER" "$GPGSQLDB" ||
echo ignoring mysqladmin drop failure
408 psql
--user="$GPGSQLUSER" "$GPGSQLDB" < ..
/pdns
/no-dnssec.schema.pgsql.sql
410 tosql gpgsql | psql
--user="$GPGSQLUSER" "$GPGSQLDB" 2>&1 |
uniq -c
412 cat > pdns-gpgsql.conf
<< __EOF__
414 gpgsql-dbname=$GPGSQLDB
415 gpgsql-user=$GPGSQLUSER
418 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
420 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gpgsql rectify-zone
$zone 2>&1
423 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
424 --no-shuffle --launch=gpgsql \
425 --send-root-referral \
426 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
427 --cache-ttl=$cachettl --no-config \
428 --gpgsql-dbname="$GPGSQLDB" \
429 --gpgsql-user="$GPGSQLUSER" &
436 sqlite3 pdns.sqlite3
< ..
/pdns
/no-dnssec.schema.sqlite3.sql
437 tosql gsqlite | sqlite3 pdns.sqlite3
438 echo ANALYZE\
; | sqlite3 pdns.sqlite3
440 cat > pdns-gsqlite3.conf
<< __EOF__
442 gsqlite3-database=pdns.sqlite3
444 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
446 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gsqlite3 rectify-zone
$zone 2>&1
449 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
450 --no-shuffle --launch=gsqlite3 \
451 --send-root-referral \
452 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
453 --cache-ttl=$cachettl --no-config \
454 --gsqlite3-database=pdns.sqlite3
&
459 rm -f pdns-opendbx.sqlite3
460 sqlite3 pdns-opendbx.sqlite3
< ..
/pdns
/no-dnssec.schema.sqlite3.sql
461 tosql gsqlite | sqlite3 pdns-opendbx.sqlite3
462 sqlite3 pdns-opendbx.sqlite3
"ALTER TABLE domains ADD status CHARACTER(1) NOT NULL DEFAULT 'A'; \
463 ALTER TABLE domains ADD auto_serial INTEGER DEFAULT 0;"
464 echo ANALYZE\
; | sqlite3 pdns-opendbx.sqlite3
466 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
467 --no-shuffle --launch=opendbx \
468 --send-root-referral \
469 --cache-ttl=$cachettl --no-config \
470 --opendbx-backend=sqlite3
--opendbx-host-read=.
/ --opendbx-host-write=.
/ \
471 --opendbx-database=pdns-opendbx.sqlite3
&
472 skipreasons
="nodnssec noent nodyndns"
475 gsqlite3 | gsqlite3-nsec3 | gsqlite3-nsec3-optout
)
477 sqlite3 pdns.sqlite3
< ..
/pdns
/no-dnssec.schema.sqlite3.sql
478 sqlite3 pdns.sqlite3
< ..
/pdns
/dnssec.schema.sqlite3.sql
479 tosql gsqlite | sqlite3 pdns.sqlite3
480 echo ANALYZE\
; | sqlite3 pdns.sqlite3
482 cat > pdns-gsqlite3.conf
<< __EOF__
484 gsqlite3-database=pdns.sqlite3
487 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
489 securezone
$zone gsqlite3
490 if [ $context = gsqlite3-nsec3
] ||
[ $context = gsqlite3-nsec3-optout
]
492 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gsqlite3 set-nsec3
$zone "1 $optout 1 abcd" 2>&1
493 ..
/pdns
/pdnssec
--config-dir=.
--config-name=gsqlite3 rectify-zone
$zone 2>&1
497 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
498 --no-shuffle --launch=gsqlite3
--gsqlite3-dnssec \
499 --send-root-referral \
500 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
501 --cache-ttl=$cachettl --no-config \
502 --gsqlite3-database=pdns.sqlite3
&
503 if [ $context = gsqlite3-nsec3
]
505 extracontexts
="dnssec nsec3"
506 elif [ $context = gsqlite3-nsec3-optout
]
508 extracontexts
="dnssec nsec3 nsec3-optout"
510 extracontexts
="dnssec"
514 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
515 --no-shuffle --launch=tinydns \
516 --cache-ttl=$cachettl --no-config \
517 --send-root-referral \
518 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
519 --tinydns-dbfile=..
/modules
/tinydnsbackend
/data.cdb
&
520 skipreasons
="nodnssec noent nodyndns"
523 remotetype
=$
(echo $context | cut
-d- -f 2)
524 remotesec
=$
(echo $context | cut
-d- -f 3)
525 narrow
=$
(echo $context | cut
-d- -f 4)
526 testsdir
=..
/modules
/remotebackend
/regression-tests
/
528 # cleanup unbound-host.conf to avoid failures
529 rm -f unbound-host.conf
533 connstr
="http:url=http://localhost:62434/dns"
534 rm -f remotebackend-server.log
535 rm -f remotebackend-access.log
536 $testsdir/http-backend.rb
&
537 echo $
! > pdns-remotebackend.pid
539 # make sure it runs before continuing
541 while [ $loopcount -lt 20 ]; do
542 res
=$
(curl http
://localhost
:62434/ping 2>/dev
/null
)
543 if [ "x$res" == "xpong" ]; then break; fi
545 let loopcount
=loopcount
+1
550 connstr
="unix:path=/tmp/remote.socket"
551 socat unix-listen
:/tmp
/remote.socket
,fork
exec:$testsdir/unix-backend.rb
&
552 echo $
! > pdns-remotebackend.pid
555 connstr
="pipe:command=$testsdir/pipe-backend.rb"
563 skipreasons
="nodnssec nodyndns"
565 if [ "$remotesec" = "nsec3" ]; then
567 if [ "$narrow" = "narrow" ]; then
568 extracontexts
="dnssec nsec3 narrow"
569 skipreasons
="narrow nsec3 nodyndns"
571 extracontexts
="dnssec nsec3"
572 skipreasons
="nsec3 nodyndns"
574 remote_add_param
="--remote-dnssec=yes"
576 if [ "$remotesec" = "dnssec" ]; then
578 remote_add_param
="--remote-dnssec=yes"
579 extracontexts
="dnssec"
580 skipreasons
="nonsec3 nonarrow nodyndns"
584 # generate pdns.conf for pdnssec
585 cat > pdns-remote.conf
<<EOF
587 remote-connection-string=$connstr
590 $RUNWRAPPER $PDNS --daemon=no
--local-port=$port --socket-dir=.
/ \
591 --no-shuffle --launch=remote \
592 --query-logging --loglevel=9 --cache-ttl=$cachettl --no-config \
593 --send-root-referral \
594 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
595 --remote-connection-string="$connstr" $remote_add_param &
597 echo "Setting up test database..."
598 # setup test database
599 rm -f $testsdir/remote.sqlite3
600 sqlite3
$testsdir/remote.sqlite3
< $testsdir/test-schema.sql
601 chmod 0666 $testsdir/remote.sqlite3
602 if [ "$remotedosec" = "yes" ]; then
603 echo "remote-dnssec=yes" >> pdns-remote.conf
604 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote import-zone-key example.com
$testsdir/example.com.ksk ksk
605 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote import-zone-key example.com
$testsdir/example.com.zsk
.1 zsk
606 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote import-zone-key example.com
$testsdir/example.com.zsk
.2 zsk
607 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote activate-zone-key example.com
1
608 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote activate-zone-key example.com
2
609 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote deactivate-zone-key example.com
3
611 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote import-zone-key up.example.com
$testsdir/up.example.com.ksk ksk
612 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote import-zone-key up.example.com
$testsdir/up.example.com.zsk
.1 zsk
613 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote import-zone-key up.example.com
$testsdir/up.example.com.zsk
.2 zsk
614 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote activate-zone-key example.com
4
615 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote activate-zone-key example.com
5
616 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote deactivate-zone-key example.com
6
618 if [ "$remotesec" = "nsec3" ]; then
619 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote set-nsec3 example.com
620 ..
/pdns
/pdnssec
--config-dir=.
--config-name=remote set-nsec3 up.example.com
627 echo unknown context
$context
629 echo 'unknown-context-'"$context" > failed_tests
643 if [ $presigned = yes ]
645 skipreasons
="$skipreasons nodyndns"
647 if [ ${context:0:6} = gmysql
]
649 context
=${context}-presigned
650 [ -z "$GMYSQL2DB" ] && GMYSQL2DB
=pdnstest2
651 [ -z "$GMYSQL2USER" ] && GMYSQL2USER
=root
652 [ -z "$GMYSQL2HOST" ] && GMYSQL2HOST
=localhost
653 [ -z "$GMYSQL2PASSWD" ] && GMYSQL2PASSWD
=''
655 mysqladmin
--user="$GMYSQL2USER" --password="$GMYSQL2PASSWD" --host="$GMYSQL2HOST" --force drop
"$GMYSQL2DB" \
656 ||
echo ignoring mysqladmin drop failure
657 mysqladmin
--user="$GMYSQL2USER" --password="$GMYSQL2PASSWD" --host="$GMYSQL2HOST" create
"$GMYSQL2DB"
658 mysql
--user="$GMYSQL2USER" --password="$GMYSQL2PASSWD" --host="$GMYSQL2HOST" \
659 "$GMYSQL2DB" < ..
/pdns
/no-dnssec.schema.mysql.sql
660 mysql
--user="$GMYSQL2USER" --password="$GMYSQL2PASSWD" --host="$GMYSQL2HOST" \
661 "$GMYSQL2DB" < ..
/pdns
/dnssec.schema.mysql.sql
663 for zone
in $
(grep zone named.conf | cut
-f2 -d\" |
tac)
665 mysql
--user="$GMYSQL2USER" --password="$GMYSQL2PASSWD" --host="$GMYSQL2HOST" \
667 -e "INSERT INTO domains (name, type, master) VALUES('$zone','SLAVE','127.0.0.1:$port')"
672 $RUNWRAPPER $PDNS2 --daemon=no
--local-port=$port --socket-dir=.
/ \
673 --no-shuffle --launch=gmysql
--gmysql-dnssec \
674 --send-root-referral \
675 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
676 --cache-ttl=$cachettl --query-cache-ttl=$cachettl --no-config --slave --retrieval-threads=4 \
677 --gmysql-dbname="$GMYSQL2DB" \
678 --gmysql-user="$GMYSQL2USER" \
679 --gmysql-host="$GMYSQL2HOST" \
680 --gmysql-password="$GMYSQL2PASSWD" \
681 --config-name=gmysql2 |
& egrep -v "update records set ordername|insert into records" &
682 echo 'waiting for zones to be slaved'
684 while [ $loopcount -lt 20 ]
687 todo
=$
(mysql
--user="$GMYSQL2USER" --password="$GMYSQL2PASSWD" --host="$GMYSQl2HOST" \
688 "$GMYSQL2DB" -ss -e 'SELECT COUNT(id) FROM domains WHERE last_check IS NULL')
693 let loopcount
=loopcount
+1
695 if [ $todo -ne 0 ]; then
696 echo "AXFR FAILED" >> failed_tests
698 elif [ ${context:0:8} = gsqlite3
]
700 context
=${context}-presigned
702 sqlite3 pdns.sqlite31
< ..
/pdns
/no-dnssec.schema.sqlite3.sql
703 sqlite3 pdns.sqlite31
< ..
/pdns
/dnssec.schema.sqlite3.sql
705 for zone
in $
(grep zone named.conf | cut
-f2 -d\" |
tac)
707 sqlite3 pdns.sqlite31
"INSERT INTO domains (name, type, master) VALUES('$zone','SLAVE','127.0.0.1:$port');"
712 $RUNWRAPPER $PDNS2 --daemon=no
--local-port=$port --socket-dir=.
/ \
713 --no-shuffle --launch=gsqlite3
--gsqlite3-dnssec \
714 --fancy-records --send-root-referral \
715 --cache-ttl=0 --query-cache-ttl=0 --no-config --slave --retrieval-threads=4 \
716 --gsqlite3-database=pdns.sqlite31
--gsqlite3-pragma-synchronous=0 \
717 --config-name=gsqlite32 |
& egrep -v "update records set ordername|insert into records" &
718 echo 'waiting for zones to be slaved'
721 while [ $loopcount -lt 20 ]
724 todo
=$
(sqlite3 pdns.sqlite31
'SELECT COUNT(id) FROM domains WHERE last_check IS NULL')
732 let loopcount
=loopcount
+1
734 if [ $todo -ne 0 ]; then
735 echo "AXFR FAILED" >> failed_tests
738 sqlite3 pdns.sqlite31 ANALYZE
;
739 elif [ ${context:0:4} = bind ]
741 context
=${context}-presigned
742 sed -e 's/type master;/type slave;\n\tmasters { 127.0.0.1:'$port'; };/' -e 's/file "\([^"]\+\)/file "\1-slave/' < named.conf
> named-slave.conf
744 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
749 rm -f dnssec-slave.sqlite3
750 ..
/pdns
/pdnssec
--config-dir=. create-bind-db dnssec-slave.sqlite3
753 $RUNWRAPPER $PDNS2 --daemon=no
--local-port=$port --socket-dir=.
/ \
754 --no-shuffle --launch=bind --bind-config=.
/named-slave.conf
--slave \
755 --send-root-referral --retrieval-threads=1 --config-name=bind-slave \
756 --allow-2136-from=127.0.0.0/8 --experimental-rfc2136=yes \
757 --cache-ttl=$cachettl --no-config --bind-dnssec-db=.
/dnssec-slave.sqlite3
&
758 echo 'waiting for zones to be loaded'
763 ## TODO: give pdns a few seconds to startup or fail, then check if it did not fail
764 ## TODO: give sdig a timeout
765 nameserver
=127.0.0.1 .
/runtests
$spectest
768 if [ "$wait" = "wait" ]
770 echo tests
done! push enter to terminate instance
773 kill $
(cat pdns
*.pid
)
776 for zone
in $
(grep zone named.conf | cut
-f2 -d\")
778 mv $zone.backup
$zone
781 failed_tests
=`wc -l failed_tests | cut -f 1 -d ' '`
782 if [ $failed_tests = 0 ];
786 for t
in `cat failed_tests`