tests.sh revision bf8267aa453e5d2a735ed732a043b77a0b355b20
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#!/bin/sh
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2004, 2007 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2000, 2001 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# Permission to use, copy, modify, and/or distribute this software for any
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# purpose with or without fee is hereby granted, provided that the above
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# copyright notice and this permission notice appear in all copies.
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt#
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# PERFORMANCE OF THIS SOFTWARE.
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# $Id: tests.sh,v 1.9 2007/09/14 01:46:05 marka Exp $
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt
b47c020d5c635b662ac57e5485d266fd62c796c0Evan HuntSYSTEMTESTTOP=..
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt. $SYSTEMTESTTOP/conf.sh
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Huntstatus=0
echo "I:test 2-element sortlist statement"
cat <<EOF >test1.good
a.example. 300 IN A 192.168.3.1
a.example. 300 IN A 192.168.1.1
a.example. 300 IN A 1.1.1.5
a.example. 300 IN A 1.1.1.1
a.example. 300 IN A 1.1.1.3
a.example. 300 IN A 1.1.1.2
a.example. 300 IN A 1.1.1.4
EOF
$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd a.example. \
@10.53.0.1 -b 10.53.0.1 -p 5300 >test1.dig
# Note that this can't use digcomp.pl because here, the ordering of the
# result RRs is significant.
diff test1.dig test1.good || status=1
echo "I:test 1-element sortlist statement and undocumented BIND 8 features"
cat <<EOF >test2.good
b.example. 300 IN A 10.53.0.$n
EOF
$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
b.example. @10.53.0.1 -b 10.53.0.2 -p 5300 | sed 1q | \
egrep '10.53.0.(2|3)$' > test2.out &&
$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
b.example. @10.53.0.1 -b 10.53.0.3 -p 5300 | sed 1q | \
egrep '10.53.0.(2|3)$' >> test2.out &&
$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
b.example. @10.53.0.1 -b 10.53.0.4 -p 5300 | sed 1q | \
egrep '10.53.0.4$' >> test2.out &&
$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
b.example. @10.53.0.1 -b 10.53.0.5 -p 5300 | sed 1q | \
egrep '10.53.0.5$' >> test2.out || status=1
echo "I:exit status: $status"
exit $status