mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
Check synth-from-dnssec XML counters
This commit is contained in:
committed by
Petr Špaček
parent
98cab76295
commit
6dcea1531d
@@ -39,3 +39,4 @@ rm -f ./wild.out ./insecure.wild.out
|
|||||||
rm -f ./wildcname.out ./insecure.wildcname.out
|
rm -f ./wildcname.out ./insecure.wildcname.out
|
||||||
rm -f ./minimal.nxdomain.out
|
rm -f ./minimal.nxdomain.out
|
||||||
rm -f ./black.out
|
rm -f ./black.out
|
||||||
|
rm -f ./xml.out*
|
||||||
|
@@ -33,6 +33,10 @@ controls {
|
|||||||
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
statistics-channels {
|
||||||
|
inet 10.53.0.1 port @EXTRAPORT1@ allow { any; };
|
||||||
|
};
|
||||||
|
|
||||||
zone "." {
|
zone "." {
|
||||||
type primary;
|
type primary;
|
||||||
file "root.db.signed";
|
file "root.db.signed";
|
||||||
|
@@ -33,6 +33,10 @@ controls {
|
|||||||
inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
statistics-channels {
|
||||||
|
inet 10.53.0.2 port @EXTRAPORT1@ allow { any; };
|
||||||
|
};
|
||||||
|
|
||||||
zone "." {
|
zone "." {
|
||||||
type hint;
|
type hint;
|
||||||
file "root.hints";
|
file "root.hints";
|
||||||
|
@@ -33,6 +33,10 @@ controls {
|
|||||||
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
statistics-channels {
|
||||||
|
inet 10.53.0.3 port @EXTRAPORT1@ allow { any; };
|
||||||
|
};
|
||||||
|
|
||||||
zone "." {
|
zone "." {
|
||||||
type hint;
|
type hint;
|
||||||
file "root.hints";
|
file "root.hints";
|
||||||
|
@@ -34,6 +34,10 @@ controls {
|
|||||||
inet 10.53.0.4 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
inet 10.53.0.4 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
statistics-channels {
|
||||||
|
inet 10.53.0.4 port @EXTRAPORT1@ allow { any; };
|
||||||
|
};
|
||||||
|
|
||||||
zone "." {
|
zone "." {
|
||||||
type hint;
|
type hint;
|
||||||
file "root.hints";
|
file "root.hints";
|
||||||
|
@@ -34,6 +34,10 @@ controls {
|
|||||||
inet 10.53.0.5 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
inet 10.53.0.5 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
statistics-channels {
|
||||||
|
inet 10.53.0.5 port @EXTRAPORT1@ allow { any; };
|
||||||
|
};
|
||||||
|
|
||||||
zone "." {
|
zone "." {
|
||||||
type hint;
|
type hint;
|
||||||
file "root.hints";
|
file "root.hints";
|
||||||
|
@@ -34,6 +34,10 @@ controls {
|
|||||||
inet 10.53.0.6 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
inet 10.53.0.6 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
statistics-channels {
|
||||||
|
inet 10.53.0.6 port @EXTRAPORT1@ allow { any; };
|
||||||
|
};
|
||||||
|
|
||||||
zone "." {
|
zone "." {
|
||||||
type hint;
|
type hint;
|
||||||
file "root.hints";
|
file "root.hints";
|
||||||
|
@@ -424,6 +424,71 @@ do
|
|||||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
status=$((status+ret))
|
status=$((status+ret))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if ${FEATURETEST} --have-libxml2 && [ -x "${CURL}" ] ; then
|
||||||
|
echo_i "getting XML statisistcs for (synth-from-dnssec ${description};) ($n)"
|
||||||
|
ret=0
|
||||||
|
xml=xml.out$n
|
||||||
|
${CURL} http://10.53.0.${ns}:${EXTRAPORT1}/xml/v3/server > $xml 2>/dev/null || ret=1
|
||||||
|
n=$((n+1))
|
||||||
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
|
status=$((status+ret))
|
||||||
|
|
||||||
|
echo_i "check XML for 'CoveringNSEC' with (synth-from-dnssec ${description};) ($n)"
|
||||||
|
ret=0
|
||||||
|
counter=$(sed -n 's;.*<view name="_default">.*\(<counter name="CoveringNSEC">[0-9]*</counter>\).*</view><view.*;\1;gp' $xml)
|
||||||
|
count=$(echo "$counter" | grep CoveringNSEC | wc -l)
|
||||||
|
test $count = 1 || ret=1
|
||||||
|
zero=$(echo "$counter" | grep ">0<" | wc -l)
|
||||||
|
if [ ${synth} = yes ]
|
||||||
|
then
|
||||||
|
test $zero = 0 || ret=1
|
||||||
|
else
|
||||||
|
test $zero = 1 || ret=1
|
||||||
|
fi
|
||||||
|
n=$((n+1))
|
||||||
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
|
status=$((status+ret))
|
||||||
|
|
||||||
|
echo_i "check XML for 'CacheNSECNodes' with (synth-from-dnssec ${description};) ($n)"
|
||||||
|
ret=0
|
||||||
|
counter=$(sed -n 's;.*<view name="_default">.*\(<counter name="CacheNSECNodes">[0-9]*</counter>\).*</view><view.*;\1;gp' $xml)
|
||||||
|
count=$(echo "$counter" | grep CacheNSECNodes | wc -l)
|
||||||
|
test $count = 1 || ret=1
|
||||||
|
zero=$(echo "$counter" | grep ">0<" | wc -l)
|
||||||
|
if [ ${ad} = yes ]
|
||||||
|
then
|
||||||
|
test $zero = 0 || ret=1
|
||||||
|
else
|
||||||
|
test $zero = 1 || ret=1
|
||||||
|
fi
|
||||||
|
n=$((n+1))
|
||||||
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
|
status=$((status+ret))
|
||||||
|
|
||||||
|
for synthesized in SynthNXDOMAIN SynthNODATA SynthWILDCARD
|
||||||
|
do
|
||||||
|
case $synthesized in
|
||||||
|
SynthNXDOMAIN) count=1;;
|
||||||
|
SynthNODATA) count=2;;
|
||||||
|
SynthWILDCARD) count=2;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo_i "check XML for '$synthesized}' with (synth-from-dnssec ${description};) ($n)"
|
||||||
|
ret=0
|
||||||
|
if [ ${synth} = yes ]
|
||||||
|
then
|
||||||
|
grep '<counter name="'$synthesized'">'$count'</counter>' $xml > /dev/null || ret=1
|
||||||
|
else
|
||||||
|
grep '<counter name="'$synthesized'">'0'</counter>' $xml > /dev/null || ret=1
|
||||||
|
fi
|
||||||
|
n=$((n+1))
|
||||||
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||||
|
status=$((status+ret))
|
||||||
|
done
|
||||||
|
else
|
||||||
|
echo_i "Skipping XML statistics checks"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo_i "check redirect response (+dnssec) (synth-from-dnssec <default>;) ($n)"
|
echo_i "check redirect response (+dnssec) (synth-from-dnssec <default>;) ($n)"
|
||||||
|
Reference in New Issue
Block a user