febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson#!/bin/sh
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2000, 2001, 2004, 2007, 2012, 2016 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews# $Id: tests.sh,v 1.9 2007/09/14 01:46:05 marka Exp $
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson
febaa091847ab004f40500cc475a819f2c73fcddAndreas GustafssonSYSTEMTESTTOP=..
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson. $SYSTEMTESTTOP/conf.sh
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafssonstatus=0
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafssonecho "I:test 2-element sortlist statement"
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafssoncat <<EOF >test1.good
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafssona.example. 300 IN A 192.168.3.1
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafssona.example. 300 IN A 192.168.1.1
917c8406f664390564755b0f59a2c9b9f0d3728aAndreas Gustafssona.example. 300 IN A 1.1.1.5
917c8406f664390564755b0f59a2c9b9f0d3728aAndreas Gustafssona.example. 300 IN A 1.1.1.1
917c8406f664390564755b0f59a2c9b9f0d3728aAndreas Gustafssona.example. 300 IN A 1.1.1.3
917c8406f664390564755b0f59a2c9b9f0d3728aAndreas Gustafssona.example. 300 IN A 1.1.1.2
917c8406f664390564755b0f59a2c9b9f0d3728aAndreas Gustafssona.example. 300 IN A 1.1.1.4
febaa091847ab004f40500cc475a819f2c73fcddAndreas GustafssonEOF
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd a.example. \
917c8406f664390564755b0f59a2c9b9f0d3728aAndreas Gustafsson @10.53.0.1 -b 10.53.0.1 -p 5300 >test1.dig
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson# Note that this can't use digcomp.pl because here, the ordering of the
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson# result RRs is significant.
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DIFF test1.dig test1.good || status=1
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson
17b687ef360ba8c07201dc6511a3c975cc1bb2a8Andreas Gustafssonecho "I:test 1-element sortlist statement and undocumented BIND 8 features"
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson cat <<EOF >test2.good
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafssonb.example. 300 IN A 10.53.0.$n
febaa091847ab004f40500cc475a819f2c73fcddAndreas GustafssonEOF
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews b.example. @10.53.0.1 -b 10.53.0.2 -p 5300 | sed 1q | \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews egrep '10.53.0.(2|3)$' > test2.out &&
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews b.example. @10.53.0.1 -b 10.53.0.3 -p 5300 | sed 1q | \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews egrep '10.53.0.(2|3)$' >> test2.out &&
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews b.example. @10.53.0.1 -b 10.53.0.4 -p 5300 | sed 1q | \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews egrep '10.53.0.4$' >> test2.out &&
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews$DIG +tcp +noadd +nosea +nostat +noquest +noauth +nocomm +nocmd \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews b.example. @10.53.0.1 -b 10.53.0.5 -p 5300 | sed 1q | \
12e0477d4e132c9122312246ed60aaa646f819b2Mark Andrews egrep '10.53.0.5$' >> test2.out || status=1
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafsson
febaa091847ab004f40500cc475a819f2c73fcddAndreas Gustafssonecho "I:exit status: $status"
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrews[ $status -eq 0 ] || exit 1