Check EDNS CLIENT-TAG and EDNS SERVER-TAG emitted YAML

Check that when a EDNS CLIENT-TAG or EDNS SERVER-TAG 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 bc823e3cef
commit 5a46ade68c
+24
View File
@@ -727,6 +727,18 @@ if [ -x "$DIG" ]; then
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 +ednsopt=client-tag:value +yaml ($n)"
ret=0
dig_with_opts @10.53.0.3 +yaml +ednsopt=client-tag:0001 a.example +qr >dig.out.test$n 2>&1 || ret=1
$PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS CLIENT-TAG >yamlget.out.test$n 2>&1 || ret=1
read -r value <yamlget.out.test$n
[ "$value" = "1" ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
fi
n=$((n + 1))
echo_i "check that FORMERR is returned for a too short client-tag ($n)"
ret=0
@@ -754,6 +766,18 @@ if [ -x "$DIG" ]; then
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 +ednsopt=server-tag:value +yaml ($n)"
ret=0
dig_with_opts @10.53.0.3 +yaml +ednsopt=server-tag:0001 a.example +qr >dig.out.test$n 2>&1 || ret=1
$PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS SERVER-TAG >yamlget.out.test$n 2>&1 || ret=1
read -r value <yamlget.out.test$n
[ "$value" = "1" ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
fi
n=$((n + 1))
echo_i "check that FORMERR is returned for a too short server-tag ($n)"
ret=0