Check that EDNS UL option is emitted using valid YAML

This commit is contained in:
Mark Andrews
2025-02-26 15:22:58 +11:00
parent 49add22f11
commit f8e31184e5
+24 -1
View File
@@ -571,6 +571,18 @@ if [ -x "$DIG" ]; then
status=$((status + ret))
n=$((n + 1))
if [ $HAS_PYYAML -ne 0 ]; then
n=$((n + 1))
echo_i "checking ednsopt UL prints as expected (single lease) +yaml ($n)"
ret=0
dig_with_opts @10.53.0.3 +yaml +ednsopt=UL:00000e10 +qr a.example >dig.out.test$n 2>&1 || ret=1
$PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UL >yamlget.out.test$n 2>&1 || ret=1
read -r value <yamlget.out.test$n
[ "$value" = "3600 (1 hour)" ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
fi
n=$((n + 1))
echo_i "checking ednsopt UL prints as expected (split lease) ($n)"
ret=0
@@ -579,7 +591,18 @@ if [ -x "$DIG" ]; then
grep "$pat" dig.out.test$n >/dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
n=$((n + 1))
if [ $HAS_PYYAML -ne 0 ]; then
n=$((n + 1))
echo_i "checking ednsopt UL prints as expected (split lease) +yaml ($n)"
ret=0
dig_with_opts @10.53.0.3 +yaml +ednsopt=UL:00000e1000127500 +qr a.example >dig.out.test$n 2>&1 || ret=1
$PYTHON yamlget.py dig.out.test$n 0 message query_message_data OPT_PSEUDOSECTION EDNS UL >yamlget.out.test$n 2>&1 || ret=1
read -r value <yamlget.out.test$n
[ "$value" = "3600/1209600 (1 hour/2 weeks)" ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status + ret))
fi
echo_i "checking ednsopt LLQ prints as expected ($n)"
ret=0