mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Check EDNS CLIENT-TAG and SERVER-TAG are emitted using valid YAML
Check that when an EDNS CLIENT-TAG or EDNS SERVER-TAG option is present in the message, the emitted YAML is valid.
This commit is contained in:
parent
e611e2044a
commit
2efb15b54a
1 changed files with 24 additions and 0 deletions
|
|
@ -733,6 +733,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
|
||||
|
|
@ -760,6 +772,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
|
||||
|
|
|
|||
Loading…
Reference in a new issue