2000-11-09 22:05:54 -05:00
|
|
|
#!/bin/sh
|
2000-11-17 22:01:17 -05:00
|
|
|
#
|
2018-02-23 03:53:12 -05:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2012-06-28 21:39:47 -04:00
|
|
|
#
|
2016-06-27 00:56:38 -04:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2018-02-23 03:53:12 -05:00
|
|
|
#
|
|
|
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
|
|
|
# information regarding copyright ownership.
|
2000-11-09 22:05:54 -05:00
|
|
|
|
|
|
|
|
SYSTEMTESTTOP=..
|
|
|
|
|
. $SYSTEMTESTTOP/conf.sh
|
|
|
|
|
|
|
|
|
|
status=0
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
DIGOPTS="-p ${PORT}"
|
2000-11-09 22:05:54 -05:00
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for various representations of an IN A record"
|
2000-11-20 16:58:45 -05:00
|
|
|
for i in 1 2 3 4 5 6 7 8 9 10 11 12
|
2000-11-09 22:05:54 -05:00
|
|
|
do
|
|
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 a$i.example a in > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo 10.0.0.1 | $DIFF - dig.out || ret=1
|
2000-11-09 22:05:54 -05:00
|
|
|
if [ $ret != 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "#$i failed"
|
|
|
|
|
fi
|
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
done
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for various representations of an IN TXT record"
|
2000-11-20 16:58:45 -05:00
|
|
|
for i in 1 2 3 4 5 6 7
|
2000-11-09 22:05:54 -05:00
|
|
|
do
|
|
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 txt$i.example txt in > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '"hello"' | $DIFF - dig.out || ret=1
|
2000-11-09 22:05:54 -05:00
|
|
|
if [ $ret != 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "#$i failed"
|
|
|
|
|
fi
|
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
done
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for various representations of an IN TYPE123 record"
|
2000-11-09 22:05:54 -05:00
|
|
|
for i in 1 2 3
|
|
|
|
|
do
|
|
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 unk$i.example type123 in > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '\# 1 00' | $DIFF - dig.out || ret=1
|
2000-11-09 22:05:54 -05:00
|
|
|
if [ $ret != 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "#$i failed"
|
|
|
|
|
fi
|
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
done
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for NULL record"
|
2011-11-01 21:01:52 -04:00
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 null.example null in > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '\# 1 00' | $DIFF - dig.out || ret=1
|
2018-02-20 18:43:27 -05:00
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2011-11-01 21:01:52 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for empty NULL record"
|
2011-11-01 21:01:52 -04:00
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 empty.example null in > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '\# 0' | $DIFF - dig.out || ret=1
|
2018-02-20 18:43:27 -05:00
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2011-11-01 21:01:52 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for various representations of a CLASS10 TYPE1 record"
|
2000-11-09 22:05:54 -05:00
|
|
|
for i in 1 2
|
|
|
|
|
do
|
|
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 a$i.example a class10 > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '\# 4 0A000001' | $DIFF - dig.out || ret=1
|
2000-11-09 22:05:54 -05:00
|
|
|
if [ $ret != 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "#$i failed"
|
|
|
|
|
fi
|
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
done
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for various representations of a CLASS10 TXT record"
|
2000-11-09 22:05:54 -05:00
|
|
|
for i in 1 2 3 4
|
|
|
|
|
do
|
|
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 txt$i.example txt class10 > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '"hello"' | $DIFF - dig.out || ret=1
|
2000-11-09 22:05:54 -05:00
|
|
|
if [ $ret != 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "#$i failed"
|
|
|
|
|
fi
|
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
done
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for various representations of a CLASS10 TYPE123 record"
|
2000-11-09 22:05:54 -05:00
|
|
|
for i in 1 2
|
|
|
|
|
do
|
|
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG +short $DIGOPTS @10.53.0.1 unk$i.example type123 class10 > dig.out || ret=1
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '\# 1 00' | $DIFF - dig.out || ret=1
|
2000-11-09 22:05:54 -05:00
|
|
|
if [ $ret != 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "#$i failed"
|
|
|
|
|
fi
|
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
done
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "querying for SOAs of zone that should have failed to load"
|
2000-11-15 18:55:07 -05:00
|
|
|
for i in 1 2 3 4
|
2000-11-09 22:05:54 -05:00
|
|
|
do
|
|
|
|
|
ret=0
|
2012-06-01 09:33:16 -04:00
|
|
|
$DIG $DIGOPTS @10.53.0.1 broken$i. soa in > dig.out || ret=1
|
2000-11-09 22:05:54 -05:00
|
|
|
grep "SERVFAIL" dig.out > /dev/null || ret=1
|
|
|
|
|
if [ $ret != 0 ]
|
|
|
|
|
then
|
|
|
|
|
echo "#$i failed"
|
|
|
|
|
fi
|
|
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
done
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "checking large unknown record loading on master"
|
2012-06-01 09:33:16 -04:00
|
|
|
ret=0
|
2018-02-20 18:43:27 -05:00
|
|
|
$DIG $DIGOPTS @10.53.0.1 +tcp +short large.example TYPE45234 > dig.out || { ret=1 ; echo_i "dig failed" ; }
|
|
|
|
|
$DIFF -s large.out dig.out > /dev/null || { ret=1 ; echo_i "$DIFF failed"; }
|
|
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2012-06-01 09:33:16 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "checking large unknown record loading on slave"
|
2012-06-01 11:29:06 -04:00
|
|
|
ret=0
|
2018-02-20 18:43:27 -05:00
|
|
|
$DIG $DIGOPTS @10.53.0.2 +tcp +short large.example TYPE45234 > dig.out || { ret=1 ; echo_i "dig failed" ; }
|
|
|
|
|
$DIFF -s large.out dig.out > /dev/null || { ret=1 ; echo_i "$DIFF failed"; }
|
|
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2012-06-01 11:29:06 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "stop and restart slave"
|
2012-06-01 11:29:06 -04:00
|
|
|
$PERL $SYSTEMTESTTOP/stop.pl . ns2
|
2018-02-20 18:43:27 -05:00
|
|
|
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} . ns2
|
2012-06-01 09:33:16 -04:00
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "checking large unknown record loading on slave"
|
2012-06-01 09:33:16 -04:00
|
|
|
ret=0
|
2018-02-20 18:43:27 -05:00
|
|
|
$DIG $DIGOPTS @10.53.0.2 +tcp +short large.example TYPE45234 > dig.out || { ret=1 ; echo_i "dig failed" ; }
|
|
|
|
|
$DIFF -s large.out dig.out > /dev/null || { ret=1 ; echo_i "$DIFF failed"; }
|
|
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2012-06-01 09:33:16 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "checking large unknown record loading on inline slave"
|
2012-06-01 09:33:16 -04:00
|
|
|
ret=0
|
2018-02-20 18:43:27 -05:00
|
|
|
$DIG $DIGOPTS @10.53.0.3 +tcp +short large.example TYPE45234 > dig.out || { ret=1 ; echo_i "dig failed" ; }
|
|
|
|
|
$DIFF large.out dig.out > /dev/null || { ret=1 ; echo_i "$DIFF failed"; }
|
|
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2012-06-01 09:33:16 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "stop and restart inline slave"
|
2012-06-01 09:33:16 -04:00
|
|
|
$PERL $SYSTEMTESTTOP/stop.pl . ns3
|
2018-02-20 18:43:27 -05:00
|
|
|
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} . ns3
|
2012-06-01 09:33:16 -04:00
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "checking large unknown record loading on inline slave"
|
2012-06-01 09:33:16 -04:00
|
|
|
ret=0
|
2018-02-20 18:43:27 -05:00
|
|
|
$DIG $DIGOPTS @10.53.0.3 +tcp +short large.example TYPE45234 > dig.out || { ret=1 ; echo_i "dig failed" ; }
|
|
|
|
|
$DIFF large.out dig.out > /dev/null || { ret=1 ; echo_i "$DIFF failed"; }
|
|
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2012-06-01 09:33:16 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "check that '"'"\\#"'"' is not treated as the unknown escape sequence"
|
2012-12-07 22:05:32 -05:00
|
|
|
ret=0
|
2012-12-07 23:33:10 -05:00
|
|
|
$DIG $DIGOPTS @10.53.0.1 +tcp +short txt8.example txt > dig.out
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '"#" "2" "0145"' | $DIFF - dig.out || ret=1
|
2018-02-20 18:43:27 -05:00
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2012-12-07 22:05:32 -05:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "check that 'TXT \# text' is not treated as the unknown escape sequence"
|
2012-12-07 22:05:32 -05:00
|
|
|
ret=0
|
2012-12-07 23:33:10 -05:00
|
|
|
$DIG $DIGOPTS @10.53.0.1 +tcp +short txt9.example txt > dig.out
|
2016-10-19 11:18:42 -04:00
|
|
|
echo '"#" "text"' | $DIFF - dig.out || ret=1
|
2018-02-20 18:43:27 -05:00
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2012-12-07 22:05:32 -05:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "check that 'TYPE353 \# cat' produces 'not a valid number'"
|
2013-04-07 19:55:14 -04:00
|
|
|
ret=0
|
|
|
|
|
$CHECKZONE nan.bad zones/nan.bad > check.out 2>&1
|
|
|
|
|
grep "not a valid number" check.out > /dev/null || ret=1
|
2018-02-20 18:43:27 -05:00
|
|
|
[ $ret = 0 ] || echo_i "failed"
|
2013-04-07 19:55:14 -04:00
|
|
|
status=`expr $status + $ret`
|
|
|
|
|
|
2018-02-20 18:43:27 -05:00
|
|
|
echo_i "exit status: $status"
|
2016-06-13 23:48:39 -04:00
|
|
|
[ $status -eq 0 ] || exit 1
|