Check that 'rndc dnstap -roll <value>' works

This commit is contained in:
Mark Andrews
2020-06-22 14:41:55 +10:00
parent 7c07129a51
commit a289a57c7f
3 changed files with 44 additions and 3 deletions

View File

@@ -758,5 +758,28 @@ lines=`$DNSTAPREAD -y large-answer.fstrm | grep -c "opcode: QUERY"`
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
test_dnstap_roll() (
ip="$1"
ns="$2"
n="$3"
$RNDCCMD -s "${ip}" dnstap -roll "${n}" | sed "s/^/${ns} /" | cat_i &&
files=$(find . -name "${ns}/dnstap.out.*" | wc -l) &&
test "$files" -le "${n}"
)
echo_i "checking 'rndc -roll <value>' (no versions)"
ret=0
start_server --noclean --restart --port "${PORT}" dnstap ns3
_repeat 5 test_dnstap_roll 10.53.0.3 ns3 3 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
echo_i "checking 'rndc -roll <value>' (versions)"
ret=0
start_server --noclean --restart --port "${PORT}" dnstap ns2
_repeat 5 test_dnstap_roll 10.53.0.2 ns2 3 || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
[ "$status" -eq 0 ] || exit 1