1#!/bin/sh
2#
3# Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
4# Copyright (C) 2001  Internet Software Consortium.
5#
6# Permission to use, copy, modify, and/or distribute this software for any
7# purpose with or without fee is hereby granted, provided that the above
8# copyright notice and this permission notice appear in all copies.
9#
10# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16# PERFORMANCE OF THIS SOFTWARE.
17
18# $Id: tests.sh,v 1.4 2007/06/19 23:47:06 tbox Exp $
19
20SYSTEMTESTTOP=..
21. $SYSTEMTESTTOP/conf.sh
22
23# ns1 = root server
24# ns2 = authoritative server
25# ns3 = recursive server doing v6 synthesis
26
27status=0
28
29DIGOPTS="+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd"
30
31for name in aaaa a6 chain alias2 aaaa.dname loop loop2
32do
33    $DIG $DIGOPTS $name.example. aaaa @10.53.0.3 -p 5300
34    echo
35done >dig.out
36
37for i in 1 2
38do
39    $DIG $DIGOPTS f.f.$i.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.5.4.3.2.1.ip6.int. PTR @10.53.0.3 -p 5300
40    echo
41done >>dig.out
42
43cat <<EOF >good.out
44aaaa.example.		0	IN	AAAA	12:34:56::ff
45
46a6.example.		0	IN	AAAA	12:34:56::ff
47
48chain.example.		0	IN	AAAA	12:34:56::ff:ff
49
50alias2.example.		0	IN	CNAME	alias.example.
51alias.example.		0	IN	CNAME	chain.example.
52chain.example.		0	IN	AAAA	12:34:56::ff:ff
53
54aaaa.dname.example.	0	IN	CNAME	aaaa.foo.example.
55aaaa.foo.example.	0	IN	AAAA	12:34:56::ff
56
57loop.example.		0	IN	CNAME	loop.example.
58
59loop2.example.		0	IN	CNAME	loop3.example.
60loop3.example.		0	IN	CNAME	loop2.example.
61
62f.f.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.5.4.3.2.1.ip6.int. 0 IN PTR foo.
63
64f.f.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.5.4.3.2.1.ip6.int. 0 IN PTR bar.
65
66EOF
67
68diff good.out dig.out || status=1
69
70echo "I:exit status: $status"
71exit $status
72