]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Test for EDE option with non-EDNS query
authorMatthijs Mekking <matthijs@isc.org>
Mon, 1 Nov 2021 07:46:35 +0000 (08:46 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 19 Nov 2021 08:44:28 +0000 (09:44 +0100)
Add a test case to make sure the EDE option is not set on an EDNS
disabled query.

bin/tests/system/allow-query/tests.sh

index 276766e3c9f35fc81abfc4f8b8a47071f9669b5c..c0398febe25ba98c16d7f8a1447452c9f67e8c6f 100644 (file)
@@ -96,6 +96,18 @@ grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+DIGNOEDNS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +noedns -p ${PORT}"
+
+echo_i "test $n: none - query refused (no edns)"
+ret=0
+$DIG $DIGNOEDNS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
+grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
+grep 'EDE: 18 (Prohibited)' dig.out.ns2.$n > /dev/null && ret=1
+grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 # Test 4 - address allowed, query allowed
 n=`expr $n + 1`
 copy_setports ns2/named04.conf.in ns2/named.conf