tests.sh revision a39a5f4d816ca7d3f43106712ca668dd1ab31d69
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews#!/bin/sh
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews#
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# Copyright (C) 2000-2002 Internet Software Consortium.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews#
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# Permission to use, copy, modify, and/or distribute this software for any
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# purpose with or without fee is hereby granted, provided that the above
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# copyright notice and this permission notice appear in all copies.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews#
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# PERFORMANCE OF THIS SOFTWARE.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# $Id: tests.sh,v 1.2 2009/11/17 23:55:18 marka Exp $
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark AndrewsSYSTEMTESTTOP=..
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews. $SYSTEMTESTTOP/conf.sh
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsstatus=0
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsn=0
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsrm -f dig.out.*
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark AndrewsDIGOPTS="+short +tcp +cd -p 5300"
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsecho I:Priming cache.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsret=0
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsexpect="10 mail.example."
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsans=`$DIG $DIGOPTS @10.53.0.4 hostile MX` || ret=1
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewstest "$ans" = "$expect" || ret=1
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewstest $ret = 0 || echo I:failed, got "'""$ans""'", expected "'""$expect""'"
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsstatus=`expr $status + $ret`
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsecho I:Checking that bogus additional is not returned with +CD.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsret=0
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsexpect="10.0.0.2"
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsans=`$DIG $DIGOPTS @10.53.0.4 mail.example A` || ret=1
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewstest "$ans" = "$expect" || ret=1
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewstest $ret = 0 || echo I:failed, got "'""$ans""'", expected "'""$expect""'"
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsstatus=`expr $status + $ret`
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsecho "I:exit status: $status"
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsexit $status