git » dnss » commit d0004ed

tests/external: Update public zones to use as targets

author Alberto Bertogli
2024-11-03 18:11:03 UTC
committer Alberto Bertogli
2024-11-03 18:11:03 UTC
parent 16ecf76ea61ab8e34f7b8411fdceb07b28008755

tests/external: Update public zones to use as targets

Some of the public zones have changed sizes, so we adjust things
accordingly. We also update our testzones to match.

tests/external.sh +8 -4
tests/testzones +56 -9

diff --git a/tests/external.sh b/tests/external.sh
index 7cb4e25..72b6736 100755
--- a/tests/external.sh
+++ b/tests/external.sh
@@ -82,8 +82,9 @@ function resolve() {
 
 	# The response exceeds the default UDP size (512b), so it should fall back
 	# to TCP. This exercises the truncating logic.
-	kdig @127.0.0.1:1053  google.com TXT > .dig.log 2>&1
-	if ! grep -E -i -q '^google.com.*TXT'  .dig.log; then
+	# Public amazon.com TXT records match this constraint.
+	kdig @127.0.0.1:1053  amazon.com TXT > .dig.log 2>&1
+	if ! grep -E -i -q '^amazon.com.*TXT'  .dig.log; then
 		echo "----- FAILED (missing response)"
 		cat .dig.log
 		return 1
@@ -94,8 +95,10 @@ function resolve() {
 		return 1
 	fi
 
-	# Same as above, but we explicitly are ok with a 2k response, which
-	# fits the reply. We check that we do NOT fall back to TCP.
+	# This is a zone that's large enough to exceed the default EDNS buffer
+	# size (1232 bytes), but within 2k, so if we explicitly are ok with a
+	# 2k response, we shouldn't fall back to TCP.
+	# Public google.com TXT records match this constraint.
 	kdig @127.0.0.1:1053 +bufsize=2048 google.com TXT > .dig.log 2>&1
 	if ! grep -E -i -q '^google.com.*TXT'  .dig.log; then
 		echo "----- FAILED (missing response)"
@@ -189,6 +192,7 @@ kill $HTTP_PID
 echo "## HTTPS with custom certificates"
 generate_certs upstream
 dnss -enable_https_to_dns \
+	-dns_upstream "127.0.0.1:1953" \
 	-https_key .certs/upstream/privkey.pem \
 	-https_cert .certs/upstream/fullchain.pem \
 	-https_server_addr "localhost:1999"
diff --git a/tests/testzones b/tests/testzones
index 35b9828..6c94abe 100644
--- a/tests/testzones
+++ b/tests/testzones
@@ -11,12 +11,59 @@ com.ar NS c.dns.ar.
 com.ar NS e.dns.ar.
 com.ar NS f.dns.ar.
 
-google.com TXT aaaaaaaaaaaaaaaaaaaaaaaaa=bbbbbbbbbbbbbbbb
-google.com TXT cccccccc=dddddddddddddddddddddddddddddddddddd
-google.com TXT eeeeeeeeeeeeeeeeeee=ffffffffffffffffffffffffffffffffffffffffffff
-google.com TXT gggggggggggggggggggggggg=hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-google.com TXT iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
-google.com TXT jjjjjjjj=kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-google.com TXT llllllllllllllllllllllll=mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
-google.com TXT nn=oooooooooooooooooooooooooooooooooooooooo
-google.com TXT pppppppppppppppppppppppppppp=qqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
+# This needs to be fairly large, to trigger a fallback to TCP in the tests,
+# but within 2k so we can test a custom EDNS buffer size.
+# The public google.com TXT records match this constraint.
+google.com TXT 00aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+google.com TXT 00bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+google.com TXT 00ccccccccccccccccccccccccccccccccccccccccccccccc
+google.com TXT 00ddddddddddddddddddddddddddddddddddddddddddddddd
+google.com TXT 00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+google.com TXT 00fffffffffffffffffffffffffffffffffffffffffffffff
+google.com TXT 00ggggggggggggggggggggggggggggggggggggggggggggggg
+google.com TXT 00hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+google.com TXT 00iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+google.com TXT 00jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+google.com TXT 11aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+google.com TXT 11bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+google.com TXT 11ccccccccccccccccccccccccccccccccccccccccccccccc
+google.com TXT 11ddddddddddddddddddddddddddddddddddddddddddddddd
+google.com TXT 11eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+google.com TXT 11fffffffffffffffffffffffffffffffffffffffffffffff
+google.com TXT 11ggggggggggggggggggggggggggggggggggggggggggggggg
+google.com TXT 11hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+google.com TXT 11iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+google.com TXT 11jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+
+# This needs to be larger than 2k.
+# The public amazon.com TXT records match this constraint.
+amazon.com TXT 22aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+amazon.com TXT 22bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+amazon.com TXT 22ccccccccccccccccccccccccccccccccccccccccccccccc
+amazon.com TXT 22ddddddddddddddddddddddddddddddddddddddddddddddd
+amazon.com TXT 22eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+amazon.com TXT 22fffffffffffffffffffffffffffffffffffffffffffffff
+amazon.com TXT 22ggggggggggggggggggggggggggggggggggggggggggggggg
+amazon.com TXT 22hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+amazon.com TXT 22iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+amazon.com TXT 22jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+amazon.com TXT 33aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+amazon.com TXT 33bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+amazon.com TXT 33ccccccccccccccccccccccccccccccccccccccccccccccc
+amazon.com TXT 33ddddddddddddddddddddddddddddddddddddddddddddddd
+amazon.com TXT 33eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+amazon.com TXT 33fffffffffffffffffffffffffffffffffffffffffffffff
+amazon.com TXT 33ggggggggggggggggggggggggggggggggggggggggggggggg
+amazon.com TXT 33hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+amazon.com TXT 33iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+amazon.com TXT 33jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
+amazon.com TXT 44aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+amazon.com TXT 44bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+amazon.com TXT 44ccccccccccccccccccccccccccccccccccccccccccccccc
+amazon.com TXT 44ddddddddddddddddddddddddddddddddddddddddddddddd
+amazon.com TXT 44eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
+amazon.com TXT 44fffffffffffffffffffffffffffffffffffffffffffffff
+amazon.com TXT 44ggggggggggggggggggggggggggggggggggggggggggggggg
+amazon.com TXT 44hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
+amazon.com TXT 44iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
+amazon.com TXT 44jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj