From c0748d071f0444c87d7423631ea45c33ce95cfb7 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 30 Oct 2024 10:30:44 +1100 Subject: [PATCH] Check EDNS CLIENT-SUBNET option is emitted using valid YAML Check that when there is an EDNS CLIENT-SUBNET option in the message, the emitted YAML is valid. (cherry picked from commit 641ca9044f7f05ed28704f43cefedd933b1c00ff) --- bin/tests/system/digdelv/tests.sh | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh index cd9d45bcc7..e34ca94c8d 100644 --- a/bin/tests/system/digdelv/tests.sh +++ b/bin/tests/system/digdelv/tests.sh @@ -482,6 +482,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 "checking dig +subnet=0 +yaml ($n)" + ret=0 + dig_with_opts +yaml +tcp @10.53.0.2 +subnet=0 A a.example >dig.out.test$n 2>&1 || ret=1 + $PYTHON yamlget.py dig.out.test$n 0 message response_message_data OPT_PSEUDOSECTION EDNS CLIENT-SUBNET >yamlget.out.test$n 2>&1 || ret=1 + read -r value dig.out.test$n 2>&1 || ret=1 + $PYTHON yamlget.py dig.out.test$n 0 message response_message_data OPT_PSEUDOSECTION EDNS CLIENT-SUBNET >yamlget.out.test$n 2>&1 || ret=1 + read -r value dig.out.test$n 2>&1 || ret=1 + $PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS CLIENT-SUBNET >yamlget.out.test$n 2>&1 || ret=1 + read -r value