]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check EDNS EXPIRE option is emitted using valid YAML
authorMark Andrews <marka@isc.org>
Wed, 30 Oct 2024 02:11:06 +0000 (13:11 +1100)
committerMark Andrews <marka@isc.org>
Mon, 21 Apr 2025 23:24:18 +0000 (09:24 +1000)
Check that when an EDNS EXPIRE option is present in the message,
the emitted YAML is valid.

bin/tests/system/digdelv/tests.sh

index 0d6bb0c02cef80d0e13ff4038b9d72bd5d377a68..aed37b6fa58d838f1c80a13bd77089cdabfa7b14 100644 (file)
@@ -819,6 +819,26 @@ if [ -x "$DIG" ]; then
     status=$((status + ret))
   fi
 
+  n=$((n + 1))
+  echo_i "check that dig processes +keepalive ($n)"
+  ret=0
+  dig_with_opts @10.53.0.1 +keepalive . soa +tcp >dig.out.test$n 2>&1 || ret=1
+  grep '; TCP-KEEPALIVE: 30.0 secs' dig.out.test$n >/dev/null || 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 "check that dig processes +keepalive +yaml ($n)"
+    ret=0
+    dig_with_opts @10.53.0.1 +yaml +keepalive . soa +tcp >dig.out.test$n 2>&1 || ret=1
+    $PYTHON yamlget.py dig.out.test$n 0 message response_message_data OPT_PSEUDOSECTION EDNS TCP-KEEPALIVE >yamlget.out.test$n 2>&1 || ret=1
+    read -r value <yamlget.out.test$n
+    [ "$value" = "30.0 secs" ] || ret=1
+    if [ $ret -ne 0 ]; then echo_i "failed"; fi
+    status=$((status + ret))
+  fi
+
   n=$((n + 1))
   echo_i "check that Extended DNS Error 0 is printed correctly ($n)"
   ret=0