]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add tests for 'dig +coflag'
authorMark Andrews <marka@isc.org>
Tue, 27 May 2025 05:12:53 +0000 (15:12 +1000)
committerMark Andrews <marka@isc.org>
Fri, 13 Jun 2025 10:31:34 +0000 (20:31 +1000)
(cherry picked from commit c56af212f06556f6009c0509a02b300200c055c1)

bin/tests/system/digdelv/tests.sh

index 8bda1f8b4e5927c5473944182c2c9df98731b6d0..79db74f8ed1d1e0bc261546e14afb516196ddfdc 100644 (file)
@@ -284,6 +284,27 @@ if [ -x "$DIG" ]; then
   if [ $ret -ne 0 ]; then echo_i "failed"; fi
   status=$((status + ret))
 
+  n=$((n + 1))
+  echo_i "checking dig +coflag works ($n)"
+  ret=0
+  dig_with_opts +tcp @10.53.0.3 +coflag +qr example >dig.out.test$n || ret=1
+  grep "^; EDNS: version: 0, flags: co;" <dig.out.test$n >/dev/null || ret=1
+  check_ttl_range dig.out.test$n "SOA" 300 || ret=1
+  if [ $ret -ne 0 ]; then echo_i "failed"; fi
+  status=$((status + ret))
+
+  if [ $HAS_PYYAML -ne 0 ]; then
+    n=$((n + 1))
+    echo_i "checking dig +coflag +yaml works ($n)"
+    ret=0
+    dig_with_opts +yaml +tcp @10.53.0.3 +coflag +qr example >dig.out.test$n || ret=1
+    $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS flags >yamlget.out.test$n 2>&1 || ret=1
+    read -r value <yamlget.out.test$n
+    [ "$value" = "co" ] || ret=1
+    if [ $ret -ne 0 ]; then echo_i "failed"; fi
+    status=$((status + ret))
+  fi
+
   n=$((n + 1))
   echo_i "checking dig +raflag works ($n)"
   ret=0