Commit 4f82cc41 authored by Diego Fronza's avatar Diego Fronza
Browse files

Added tests for tries=1 and retry=0 on TCP EOF

Added tests to ensure that dig won't retry sending a query over tcp
(+tcp) when a TCP connection is closed prematurely (EOF is read) if
either +tries=1 or retry=0 is specified on the command line.
parent e6808960
......@@ -857,6 +857,25 @@ if [ -x "$DIG" ] ; then
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking +tries=1 won't retry twice upon TCP EOF ($n)"
ret=0
echo "no_response no_response" | sendcmd 10.53.0.5
dig_with_opts @10.53.0.5 example AXFR +tries=1 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking +retry=0 won't retry twice upon TCP EOF ($n)"
ret=0
dig_with_opts @10.53.0.5 example AXFR +retry=0 > dig.out.test$n 2>&1 && ret=1
# Sanity check: ensure ans5 behaves as expected.
[ `grep "communications error.*end of file" dig.out.test$n | wc -l` -eq 1 ] || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "check that dig +expandaaaa works ($n)"
ret=0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment