From 082f22b2ff22ecfffe69d32aac3d3d3d9af1be2c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 30 Oct 2024 13:11:06 +1100 Subject: [PATCH] Check EDNS EXPIRE option is emitted using valid YAML Check that when an EDNS EXPIRE option is present in the message, the emitted YAML is valid. (cherry picked from commit e611e2044a5a79308edbe6257166411973210e45) --- bin/tests/system/digdelv/tests.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index e34ca94c8d..e1ae46bf0c 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -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