setup.sh 2.8 KB
Newer Older
Michael Sawyer's avatar
Michael Sawyer committed
1 2
#!/bin/sh
#
Tinderbox User's avatar
Tinderbox User committed
3
# Copyright (C) 2004, 2007, 2009-2012, 2014  Internet Systems Consortium, Inc. ("ISC")
Mark Andrews's avatar
Mark Andrews committed
4 5 6 7 8 9 10 11 12 13 14 15 16
# Copyright (C) 2000, 2001  Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
Michael Sawyer's avatar
Michael Sawyer committed
17

18 19
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
Michael Sawyer's avatar
Michael Sawyer committed
20

21
test -r $RANDFILE || $GENRANDOM 400 $RANDFILE
22

Michael Sawyer's avatar
Michael Sawyer committed
23 24 25 26 27
#
# jnl and database files MUST be removed before we start
#

rm -f ns1/*.jnl ns1/example.db ns2/*.jnl ns2/example.bk
28
rm -f ns2/update.bk ns2/update.alt.bk
29
rm -f ns3/example.db.jnl
Michael Sawyer's avatar
Michael Sawyer committed
30

31
cp -f ns1/example1.db ns1/example.db
32
sed 's/example.nil/other.nil/g' ns1/example1.db > ns1/other.db
33
sed 's/example.nil/unixtime.nil/g' ns1/example1.db > ns1/unixtime.db
34
sed 's/example.nil/yyyymmddvv.nil/g' ns1/example1.db > ns1/yyyymmddvv.db
35
sed 's/example.nil/keytests.nil/g' ns1/example1.db > ns1/keytests.db
36
cp -f ns3/example.db.in ns3/example.db
Michael Sawyer's avatar
Michael Sawyer committed
37

38 39 40 41 42 43 44 45 46 47 48 49 50 51
# update_test.pl has its own zone file because it
# requires a specific NS record set.
cat <<\EOF >ns1/update.db
$ORIGIN .
$TTL 300        ; 5 minutes
update.nil              IN SOA  ns1.example.nil. hostmaster.example.nil. (
                                1          ; serial
                                2000       ; refresh (2000 seconds)
                                2000       ; retry (2000 seconds)
                                1814400    ; expire (3 weeks)
                                3600       ; minimum (1 hour)
                                )
update.nil.             NS      ns1.update.nil.
ns1.update.nil.         A       10.53.0.2
52
ns2.update.nil.		AAAA	::1
53
EOF
54

55
$DDNSCONFGEN -q -r $RANDFILE -z example.nil > ns1/ddns.key
56 57 58 59 60 61 62

$DDNSCONFGEN -q -r $RANDFILE -a hmac-md5 -k md5-key -z keytests.nil > ns1/md5.key
$DDNSCONFGEN -q -r $RANDFILE -a hmac-sha1 -k sha1-key -z keytests.nil > ns1/sha1.key
$DDNSCONFGEN -q -r $RANDFILE -a hmac-sha224 -k sha224-key -z keytests.nil > ns1/sha224.key
$DDNSCONFGEN -q -r $RANDFILE -a hmac-sha256 -k sha256-key -z keytests.nil > ns1/sha256.key
$DDNSCONFGEN -q -r $RANDFILE -a hmac-sha384 -k sha384-key -z keytests.nil > ns1/sha384.key
$DDNSCONFGEN -q -r $RANDFILE -a hmac-sha512 -k sha512-key -z keytests.nil > ns1/sha512.key
63

64
(cd ns3; $SHELL -e sign.sh)
65 66 67

cp -f ns1/many.test.db.in ns1/many.test.db
rm -f ns1/many.test.db.jnl