mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-26 03:34:55 +02:00
add more tests
This commit is contained in:
Vendored
+5
@@ -13,9 +13,14 @@ server:
|
||||
|
||||
module-config: "respip validator iterator"
|
||||
|
||||
access-control: 127.0.0.2/32 refuse
|
||||
|
||||
local-zone: hopsa.kidee. always_refuse
|
||||
local-data: "hopsa.kidee. TXT hela hola"
|
||||
|
||||
localzone: nlnetlabs.nl transparant
|
||||
local-data: "hopsa.nlnetlabs.nl. TXT hela hola"
|
||||
|
||||
local-zone: uva.nl. always_null
|
||||
|
||||
local-zone: example.com redirect
|
||||
|
||||
Vendored
+36
-5
@@ -7,12 +7,13 @@
|
||||
. ../common.sh
|
||||
get_random_port 2
|
||||
UNBOUND_PORT=$RND_PORT
|
||||
FWD_PORT=$(($RND_PORT + 1))
|
||||
UNBOUND_PORT2=$(($RND_PORT + 1))
|
||||
echo "UNBOUND_PORT=$UNBOUND_PORT" >> .tpkg.var.test
|
||||
echo "FWD_PORT=$FWD_PORT" >> .tpkg.var.test
|
||||
echo "UNBOUND_PORT=2=$UNBOUND_PORT2" >> .tpkg.var.test
|
||||
|
||||
# rewrite config file with created ports
|
||||
sed -e 's/@PORT\@/'$UNBOUND_PORT'/' < ede.conf > ub.conf
|
||||
sed -e 's/@PORT2\@/'$UNBOUND_PORT2'/' < ede-auth.conf > ub2.conf
|
||||
|
||||
# start unbound in the background
|
||||
PRE="../.."
|
||||
@@ -20,6 +21,11 @@ $PRE/unbound -d -c ub.conf > unbound.log 2>&1 &
|
||||
UNBOUND_PID=$!
|
||||
echo "UNBOUND_PID=$UNBOUND_PID" >> .tpkg.var.test
|
||||
|
||||
# start "authoritative unbound" in the background
|
||||
$PRE/unbound -d -c ub.conf > unbound.log 2>&1 &
|
||||
UNBOUND_PID2=$!
|
||||
echo "UNBOUND_PID2=$UNBOUND_PID2" >> .tpkg.var.test
|
||||
|
||||
|
||||
# query with bad edns keepalive
|
||||
dig @127.0.0.1 -p $UNBOUND_PORT +tcp +ednsopt=11:010203 > keepalive.txt
|
||||
@@ -72,9 +78,9 @@ then
|
||||
fi
|
||||
|
||||
# RPZ always_refuse
|
||||
dig @127.0.0.1 -p $UNBOUND_PORT hopsa.kidee. A > always_refuse_forged.txt
|
||||
dig @127.0.0.1 -p $UNBOUND_PORT hopsa.kidee. A > always_refuse.txt
|
||||
|
||||
if ! grep -q "OPT=15: 00 04" always_refuse_forged.txt
|
||||
if ! grep -q "OPT=15: 00 04" always_refuse.txt
|
||||
then
|
||||
echo "local-zone always_null must have EDE blocked code"
|
||||
exit 1
|
||||
@@ -92,5 +98,30 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# local data forged answer
|
||||
dig @127.0.0.1 -p $UNBOUND_PORT hopsa.nlnetlabs.nl TXT
|
||||
|
||||
# ACL refused, EDE prohibited
|
||||
dig @127.0.0.1 -b 127.0.0.2 example.com > refused.txt
|
||||
|
||||
if ! grep -q "OPT=15: 00 12" refused.txt
|
||||
then
|
||||
echo "ACL refused does not give EDE prohibited"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# DNSSEC indeterminate
|
||||
|
||||
# ZONE KEY TOEVOEGEN AAN UNBOUND
|
||||
# SIGNEN MET LDNS SIGNER
|
||||
# MAKE ZONE RECORD WITH EXPIRED AND NOT INCEPTED RECORD
|
||||
# zone aanmaken met auth-zone op een tweede unbound
|
||||
|
||||
|
||||
|
||||
|
||||
# teardown
|
||||
kill_pid $UNBOUND_PID
|
||||
kill_pid $UNBOUND_PID
|
||||
kill_pid $UNBOUND_PID2
|
||||
Reference in New Issue
Block a user