tests.sh revision 247bf378605811d695e968dbe930a7fc45c0038e
71cef386fae61275b03e203825680b39fedaa8c6Tinderbox User * Copyright (C) 2008 Internet Systems Consortium, Inc. ("ISC")
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User * Permission to use, copy, modify, and/or distribute this software for any
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User * purpose with or without fee is hereby granted, provided that the above
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User * copyright notice and this permission notice appear in all copies.
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
10b865e9187fc77cae02f106ddcc9e03eecdfe06Tinderbox User# $Id: tests.sh,v 1.4 2008/07/19 00:02:14 each Exp $
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterDIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd"
10b865e9187fc77cae02f106ddcc9e03eecdfe06Tinderbox Userecho "I:testing basic ACL processing"
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# key "one" should fail
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatergrep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# any other key should be fine
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usergrep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# prefix 10/8 should fail
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usergrep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# any other address should work, as long as it sends key "one"
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User @10.53.0.2 -b 127.0.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usergrep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox Usergrep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntecho "I:testing nested ACL processing"
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# all combinations of 10.53.0.{1|2} with key {one|two}, should succeed
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
7e71f05d8643aca84914437c900cb716444507e4Tinderbox User# should succeed
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 -p 5300 > dig.out
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatergrep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
7911e6f9de303bca5a3d8b34f4330c8f7cecffaeTinderbox User# should succeed
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 -p 5300 > dig.out
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatergrep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# should succeed
10b865e9187fc77cae02f106ddcc9e03eecdfe06Tinderbox User @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatergrep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# should succeed
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
10b865e9187fc77cae02f106ddcc9e03eecdfe06Tinderbox Usergrep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# but only one or the other should fail
c313914d0e66b20969215e519bbf2ab4ecf39512Tinderbox User @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatergrep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
t=`expr $t + 1`
t=`expr $t + 1`
t=`expr $t + 1`
t=`expr $t + 1`
t=`expr $t + 1`
t=`expr $t + 1`
t=`expr $t + 1`
echo "I:exit status: $status"
exit $status