xref: /netbsd-src/external/mpl/bind/dist/bin/tests/system/masterformat/setup.sh (revision 9689912e6b171cbda866ec33f15ae94a04e2c02d)
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# shellcheck source=conf.sh
15. ../conf.sh
16
17copy_setports ns1/named.conf.in ns1/named.conf
18copy_setports ns2/named.conf.in ns2/named.conf
19copy_setports ns3/named.conf.in ns3/named.conf
20copy_setports ns4/named1.conf.in ns4/named.conf
21
22cp ns1/example.db ns2/
23cp ns2/formerly-text.db.in ns2/formerly-text.db
24cp ns1/empty.db.in ns1/under-limit.db
25
26# counts are set with respect to these limits in named.conf:
27#	max-records-per-type 2050;
28#	max-types-per-name 500;
29awk 'END {
30	 for (i = 0; i < 500; i++ ) { print "500-txt TXT", i; }
31	 for (i = 0; i < 1000; i++ ) { print "1000-txt TXT", i; }
32	 for (i = 0; i < 2000; i++ ) { print "2000-txt TXT", i; }
33}' </dev/null >>ns1/under-limit.db
34cp ns1/under-limit.db ns1/under-limit-kasp.db
35
36cp ns1/empty.db.in ns1/below-limit.db
37awk 'END {
38	 for (i = 0; i < 500; i++ ) { print "500-txt TXT", i; }
39	 for (i = 0; i < 1000; i++ ) { print "1000-txt TXT", i; }
40	 for (i = 0; i < 2000; i++ ) { print "2000-txt TXT", i; }
41	 for (i = 0; i < 2050; i++ ) { print "2050-txt TXT", i; }
42}' </dev/null >>ns1/below-limit.db
43cp ns1/below-limit.db ns1/below-limit-kasp.db
44
45cp ns1/empty.db.in ns1/above-limit.db
46awk 'END {
47	 for (i = 0; i < 500; i++ ) { print "500-txt TXT", i; }
48	 for (i = 0; i < 1000; i++ ) { print "1000-txt TXT", i; }
49	 for (i = 0; i < 2000; i++ ) { print "2000-txt TXT", i; }
50	 for (i = 0; i < 2050; i++ ) { print "2050-txt TXT", i; }
51	 for (i = 0; i < 2100; i++ ) { print "2100-txt TXT", i; }
52}' </dev/null >>ns1/above-limit.db
53
54cp ns1/empty.db.in ns1/255types.db
55for ntype in $(seq 65280 65534); do
56  echo "m TYPE${ntype} \# 0"
57done >>ns1/255types.db
58echo "m TXT bunny" >>ns1/255types.db
59(cd ns1 && $SHELL compile.sh)
60(cd ns4 && $SHELL compile.sh)
61