xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/upforwd/setup.sh (revision 32d1c65c71fbdb65a012e8392a62a757dd6853e9)
1#!/bin/sh
2
3# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4#
5# SPDX-License-Identifier: MPL-2.0
6#
7# This Source Code Form is subject to the terms of the Mozilla Public
8# License, v. 2.0.  If a copy of the MPL was not distributed with this
9# file, you can obtain one at https://mozilla.org/MPL/2.0/.
10#
11# See the COPYRIGHT file distributed with this work for additional
12# information regarding copyright ownership.
13
14. ../conf.sh
15
16cp -f ns1/example1.db ns1/example.db
17cp -f ns3/noprimary.db ns3/noprimary1.db
18
19copy_setports ns1/named.conf.in ns1/named.conf
20copy_setports ns2/named.conf.in ns2/named.conf
21copy_setports ns3/named1.conf.in ns3/named.conf
22
23if $FEATURETEST --enable-dnstap; then
24  cat <<'EOF' >ns3/dnstap.conf
25	dnstap-identity "ns3";
26	dnstap-version "xxx";
27	dnstap-output file "dnstap.out";
28	dnstap { all; };
29EOF
30else
31  echo "/* DNSTAP NOT ENABLED */" >ns3/dnstap.conf
32fi
33
34#
35# SIG(0) required cryptographic support which may not be configured.
36#
37keyname=$($KEYGEN -q -n HOST -a ${DEFAULT_ALGORITHM} -b 1024 -T KEY sig0.example2 2>keyname.err)
38if test -n "$keyname"; then
39  cat ns1/example1.db $keyname.key >ns1/example2.db
40  echo $keyname >keyname
41else
42  cat ns1/example1.db >ns1/example2.db
43fi
44cat_i <keyname.err
45