- Fix ip_ratelimit test to work with dig that enables DNS cookies.

This commit is contained in:
W.C.A. Wijngaards 2023-08-17 15:43:14 +02:00
parent 4844fa3481
commit 5f423906de
2 changed files with 12 additions and 5 deletions

View File

@ -10,6 +10,7 @@
`queries_cookie_invalid` information. The `ip\-ratelimit\-cookie:`
value determines a rate limit for queries with cookies, if desired.
- Fix regional_alloc_init for potential unaligned source of the copy.
- Fix ip_ratelimit test to work with dig that enables DNS cookies.
2 August 2023: George
- Move a cache reply callback in worker.c closer to the cache reply

View File

@ -15,8 +15,14 @@ get_make
total_runs=6
success_threshold=4 # 2/3*total_runs
if dig -h 2>&1 | grep "cookie" >/dev/null; then
nocookie="+nocookie"
else
nocookie=""
fi
echo "> First get a valid cookie"
dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:0102030405060708 +tcp +retry=0 +time=1 test. TXT >outfile 2>&1
dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:0102030405060708 $nocookie +tcp +retry=0 +time=1 test. TXT >outfile 2>&1
if test "$?" -ne 0; then
echo "exit status not OK"
echo "> cat logfiles"
@ -56,7 +62,7 @@ for i in $(seq 1 $total_runs); do
exit 1
fi
# Expect no answer because of limit
dig @127.0.0.1 -p $UNBOUND_PORT +retry=0 +time=1 test. TXT >outfile 2>&1
dig @127.0.0.1 -p $UNBOUND_PORT $nocookie +retry=0 +time=1 test. TXT >outfile 2>&1
if test "$?" -eq 0; then
continue
fi
@ -71,7 +77,7 @@ for i in $(seq 1 $total_runs); do
exit 1
fi
# Expect answer because of DNS cookie
dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:$cookie +retry=0 +time=1 test. TXT >outfile 2>&1
dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:$cookie $nocookie +retry=0 +time=1 test. TXT >outfile 2>&1
if test "$?" -ne 0; then
continue
fi
@ -118,7 +124,7 @@ for i in $(seq 1 $total_runs); do
exit 1
fi
# Expect no answer because of limit
dig @127.0.0.1 -p $UNBOUND_PORT +retry=0 +time=1 test. TXT >outfile 2>&1
dig @127.0.0.1 -p $UNBOUND_PORT $nocookie +retry=0 +time=1 test. TXT >outfile 2>&1
if test "$?" -eq 0; then
continue
fi
@ -133,7 +139,7 @@ for i in $(seq 1 $total_runs); do
exit 1
fi
# Expect no answer because of ip-ratelimit-cookie
dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:$cookie +retry=0 +time=1 test. TXT >outfile 2>&1
dig @127.0.0.1 -p $UNBOUND_PORT +ednsopt=10:$cookie $nocookie +retry=0 +time=1 test. TXT >outfile 2>&1
if test "$?" -eq 0; then
continue
fi