Check the EDNS EXPIRE option is emitted using valid YAML

Check that when a EDNS EXPIRE option is present in the message that
the emitted YAML is valid.
This commit is contained in:
Mark Andrews
2025-02-26 15:22:58 +11:00
parent b657ac830a
commit bc823e3cef
+20
View File
@@ -792,6 +792,26 @@ if [ -x "$DIG" ]; then
status=$((status + ret))
fi
n=$((n + 1))
echo_i "check that dig processes +expire ($n)"
ret=0
dig_with_opts @10.53.0.1 +expire . soa >dig.out.test$n 2>&1 || ret=1
grep '; EXPIRE: 1200 (20 minutes)' 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 +expire +yaml ($n)"
ret=0
dig_with_opts @10.53.0.1 +yaml +expire . soa >dig.out.test$n 2>&1 || ret=1
$PYTHON yamlget.py dig.out.test$n 0 message response_message_data OPT_PSEUDOSECTION EDNS EXPIRE >yamlget.out.test$n 2>&1 || ret=1
read -r value <yamlget.out.test$n
[ "$value" = "1200 (20 minutes)" ] || 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