Package: bind9 / 1:9.16.50-1~deb11u2

0018-Add-test-for-not-loading-and-not-transfering-huge-RR.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
From: =?utf-8?b?T25kxZllaiBTdXLDvQ==?= <ondrej@isc.org>
Date: Thu, 23 May 2024 19:12:40 +0200
Subject: Add test for not-loading and not-transfering huge RRSets

Add two new masterformat tests - the 'huge' zone fits within the ns1
limit and loads on the primary ns1 server, but must not transfer to the
ns2 secondary, and the 'uber' zone should not even load on the primary
ns1 server.

(cherry picked from commit cee9ad81db6e5a1167b311e5c2f42cf65ba457cd)
---
 bin/tests/system/limits/ns1/named.conf.in       |  1 +
 bin/tests/system/masterformat/clean.sh          |  2 +
 bin/tests/system/masterformat/ns1/compile.sh    |  2 +
 bin/tests/system/masterformat/ns1/huge.db.in    | 22 +++++++++
 bin/tests/system/masterformat/ns1/named.conf.in | 15 +++++++
 bin/tests/system/masterformat/ns1/uber.db.in    | 22 +++++++++
 bin/tests/system/masterformat/ns2/named.conf.in |  8 ++++
 bin/tests/system/masterformat/setup.sh          | 19 +++++++-
 bin/tests/system/masterformat/tests.sh          | 60 ++++++++++++++++++++++++-
 9 files changed, 147 insertions(+), 4 deletions(-)
 create mode 100644 bin/tests/system/masterformat/ns1/huge.db.in
 create mode 100644 bin/tests/system/masterformat/ns1/uber.db.in

diff --git a/bin/tests/system/limits/ns1/named.conf.in b/bin/tests/system/limits/ns1/named.conf.in
index 118fdbd..cf0aa78 100644
--- a/bin/tests/system/limits/ns1/named.conf.in
+++ b/bin/tests/system/limits/ns1/named.conf.in
@@ -22,6 +22,7 @@ options {
 	recursion no;
 	notify yes;
 	minimal-responses no;
+	max-records-per-type 0;
 };
 
 zone "." {
diff --git a/bin/tests/system/masterformat/clean.sh b/bin/tests/system/masterformat/clean.sh
index c53c7ab..c606c61 100755
--- a/bin/tests/system/masterformat/clean.sh
+++ b/bin/tests/system/masterformat/clean.sh
@@ -16,6 +16,8 @@ rm -f ./ns1/example.db.compat
 rm -f ./ns1/example.db.serial.raw
 rm -f ./ns1/large.db ./ns1/large.db.raw
 rm -f ./ns1/example.db.map ./ns1/signed.db.map
+rm -f ./ns1/huge.db ./ns1/huge.db.raw
+rm -f ./ns1/uber.db ./ns1/uber.db.raw
 rm -f ./ns1/session.key
 rm -f ./dig.out.*
 rm -f ./dig.out
diff --git a/bin/tests/system/masterformat/ns1/compile.sh b/bin/tests/system/masterformat/ns1/compile.sh
index ad24bb3..3427954 100755
--- a/bin/tests/system/masterformat/ns1/compile.sh
+++ b/bin/tests/system/masterformat/ns1/compile.sh
@@ -29,6 +29,8 @@ $CHECKZONE -D -F raw -L 3333 -o example.db.serial.raw example \
 $CHECKZONE -D -F raw -o large.db.raw large large.db >/dev/null 2>&1
 $CHECKZONE -D -F map -o example.db.map example-map \
   example.db >/dev/null 2>&1
+$CHECKZONE -D -F raw -o huge.db.raw huge huge.db >/dev/null 2>&1
+$CHECKZONE -D -F raw -o uber.db.raw uber uber.db >/dev/null 2>&1
 
 $KEYGEN -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -f KSK signed >/dev/null 2>&1
 $KEYGEN -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" signed >/dev/null 2>&1
diff --git a/bin/tests/system/masterformat/ns1/huge.db.in b/bin/tests/system/masterformat/ns1/huge.db.in
new file mode 100644
index 0000000..5a81863
--- /dev/null
+++ b/bin/tests/system/masterformat/ns1/huge.db.in
@@ -0,0 +1,22 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0.  If a copy of the MPL was not distributed with this
+; file, you can obtain one at https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL 1D
+
+@			IN SOA	ns hostmaster (
+				1
+				3600
+				1800
+				1814400
+				3
+				)
+			NS	ns
+ns			A	10.53.0.1
diff --git a/bin/tests/system/masterformat/ns1/named.conf.in b/bin/tests/system/masterformat/ns1/named.conf.in
index cc95655..1434ec3 100644
--- a/bin/tests/system/masterformat/ns1/named.conf.in
+++ b/bin/tests/system/masterformat/ns1/named.conf.in
@@ -22,6 +22,7 @@ options {
 	notify no;
 	session-keyfile "session.key";
 	servfail-ttl 0;
+	max-records-per-type 2050;
 };
 
 key rndc_key {
@@ -77,6 +78,20 @@ zone "large" {
 	allow-transfer { any; };
 };
 
+zone "huge" {
+	type primary;
+	file "huge.db.raw";
+	masterfile-format raw;
+	allow-transfer { any; };
+};
+
+zone "uber" {
+	type primary;
+	file "uber.db.raw";
+	masterfile-format raw;
+	allow-transfer { any; };
+};
+
 zone "signed" {
 	type primary;
 	file "signed.db.map";
diff --git a/bin/tests/system/masterformat/ns1/uber.db.in b/bin/tests/system/masterformat/ns1/uber.db.in
new file mode 100644
index 0000000..5a81863
--- /dev/null
+++ b/bin/tests/system/masterformat/ns1/uber.db.in
@@ -0,0 +1,22 @@
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; This Source Code Form is subject to the terms of the Mozilla Public
+; License, v. 2.0.  If a copy of the MPL was not distributed with this
+; file, you can obtain one at https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL 1D
+
+@			IN SOA	ns hostmaster (
+				1
+				3600
+				1800
+				1814400
+				3
+				)
+			NS	ns
+ns			A	10.53.0.1
diff --git a/bin/tests/system/masterformat/ns2/named.conf.in b/bin/tests/system/masterformat/ns2/named.conf.in
index c0f2987..df778bc 100644
--- a/bin/tests/system/masterformat/ns2/named.conf.in
+++ b/bin/tests/system/masterformat/ns2/named.conf.in
@@ -21,6 +21,7 @@ options {
 	recursion no;
 	notify no;
 	servfail-ttl 0;
+	max-records-per-type 2000;
 };
 
 zone "example" {
@@ -61,3 +62,10 @@ zone "large" {
 	masterfile-format raw;
 	file "large.bk";
 };
+
+zone "huge" {
+	type secondary;
+	primaries { 10.53.0.1; };
+	masterfile-format raw;
+	file "huge.bk";
+};
diff --git a/bin/tests/system/masterformat/setup.sh b/bin/tests/system/masterformat/setup.sh
index f304242..57b8a24 100755
--- a/bin/tests/system/masterformat/setup.sh
+++ b/bin/tests/system/masterformat/setup.sh
@@ -24,8 +24,23 @@ cp ns1/example.db ns2/
 cp ns2/formerly-text.db.in ns2/formerly-text.db
 cp ns1/large.db.in ns1/large.db
 awk 'END {
-	 for (i = 0; i < 512; i++ ) { print "a TXT", i; }
-	 for (i = 0; i < 1024; i++ ) { print "b TXT", i; }
+	 for (i = 0; i < 500; i++ ) { print "a TXT", i; }
+	 for (i = 0; i < 1000; i++ ) { print "b TXT", i; }
 	 for (i = 0; i < 2000; i++ ) { print "c TXT", i; }
 }' </dev/null >>ns1/large.db
+cp ns1/huge.db.in ns1/huge.db
+awk 'END {
+	 for (i = 0; i < 500; i++ ) { print "a TXT", i; }
+	 for (i = 0; i < 1000; i++ ) { print "b TXT", i; }
+	 for (i = 0; i < 2000; i++ ) { print "c TXT", i; }
+	 for (i = 0; i < 2050; i++ ) { print "d TXT", i; }
+}' </dev/null >>ns1/huge.db
+cp ns1/uber.db.in ns1/uber.db
+awk 'END {
+	 for (i = 0; i < 500; i++ ) { print "a TXT", i; }
+	 for (i = 0; i < 1000; i++ ) { print "b TXT", i; }
+	 for (i = 0; i < 2000; i++ ) { print "c TXT", i; }
+	 for (i = 0; i < 2050; i++ ) { print "d TXT", i; }
+	 for (i = 0; i < 2100; i++ ) { print "e TXT", i; }
+}' </dev/null >>ns1/uber.db
 cd ns1 && $SHELL compile.sh
diff --git a/bin/tests/system/masterformat/tests.sh b/bin/tests/system/masterformat/tests.sh
index 3a4eb3e..f88916d 100755
--- a/bin/tests/system/masterformat/tests.sh
+++ b/bin/tests/system/masterformat/tests.sh
@@ -188,8 +188,64 @@ echo_i "checking that large rdatasets loaded ($n)"
 for i in 0 1 2 3 4 5 6 7 8 9; do
   ret=0
   for a in a b c; do
-    $DIG +tcp txt "${a}.large" @10.53.0.2 -p "${PORT}" >"dig.out.ns2.test$n"
-    grep "status: NOERROR" "dig.out.ns2.test$n" >/dev/null || ret=1
+    $DIG +tcp txt "${a}.large" @10.53.0.1 -p "${PORT}" >"dig.out.ns1.$a.test$n"
+    grep "status: NOERROR" "dig.out.ns1.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that large rdatasets transfered ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c; do
+    $DIG +tcp txt "${a}.large" @10.53.0.2 -p "${PORT}" >"dig.out.ns2.$a.test$n"
+    grep "status: NOERROR" "dig.out.ns2.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that huge rdatasets loaded ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c d; do
+    $DIG +tcp txt "${a}.huge" @10.53.0.1 -p "${PORT}" >"dig.out.ns1.$a.test$n"
+    grep "status: NOERROR" "dig.out.ns1.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that huge rdatasets not transfered ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c d; do
+    $DIG +tcp txt "${a}.huge" @10.53.0.2 -p "${PORT}" >"dig.out.ns2.$a.test$n"
+    grep "status: SERVFAIL" "dig.out.ns2.$a.test$n" >/dev/null || ret=1
+  done
+  [ $ret -eq 0 ] && break
+  sleep 1
+done
+n=$((n + 1))
+[ $ret -eq 0 ] || echo_i "failed"
+status=$((status + ret))
+
+echo_i "checking that uber rdatasets not loaded ($n)"
+for i in 0 1 2 3 4 5 6 7 8 9; do
+  ret=0
+  for a in a b c d e; do
+    $DIG +tcp txt "${a}.uber" @10.53.0.1 -p "${PORT}" >"dig.out.ns1.$a.test$n"
+    grep "status: SERVFAIL" "dig.out.ns1.$a.test$n" >/dev/null || ret=1
   done
   [ $ret -eq 0 ] && break
   sleep 1