Commit 47a4e0ee authored by Mark Andrews's avatar Mark Andrews
Browse files

check that the time between notify messages is not too small

parent ff20b804
Pipeline #7906 passed with stages
in 19 minutes and 26 seconds
......@@ -13,15 +13,17 @@
# Clean up after zone transfer tests.
#
rm -f */named.memstats
rm -f */named.run */named.run.prev
rm -f */named.conf
rm -f */named.memstats
rm -f */named.port
rm -f */named.run */named.run.prev
rm -f awk.out.ns?.test*
rm -f dig.out.?.ns5.test*
rm -f dig.out.ns2.test*
rm -f dig.out.ns3.test*
rm -f dig.out.ns4.test*
rm -f log.out
rm -f ns*/managed-keys.bind* ns*/*.mkeys*
rm -f ns*/named.lock
rm -f ns2/example.db
rm -f ns2/x21.db*
......@@ -33,4 +35,3 @@ rm -f ns5/x21.bk-c
rm -f ns5/x21.bk-c.jnl
rm -f ns5/x21.db.jnl
rm -f tmp
rm -f ns*/managed-keys.bind* ns*/*.mkeys*
......@@ -53,12 +53,34 @@ status=`expr $ret + $status`
n=`expr $n + 1`
echo_i "checking startup notify rate limit ($n)"
ret=0
grep 'x[0-9].*sending notify to' ns2/named.run |
sed 's/.*:\([0-9][0-9]\)\..*/\1/' | uniq -c | awk '{print $1}' > log.out
# the notifies should span at least 4 seconds
wc -l log.out | awk '$1 < 4 { exit(1) }' || ret=1
# ... with no more than 5 in any one second
awk '$1 > 5 { exit(1) }' log.out || ret=1
awk '/x[0-9].*sending notify to/ {
split($2, a, ":");
this = a[1] * 3600 + a[2] * 60 + a[3];
if (lasta1 && lasta1 > a[1]) {
fix = 3600 * 24;
}
this += fix;
if (last) {
delta = this - last;
print delta;
if (!maxdelta || delta > maxdelta) {
maxdelta = delta;
}
if (!mindelta || delta < mindelta) {
mindelta = delta;
}
}
lasta1 = a[1];
last = this;
count++;
}
END {
print "mindelta:", mindelta
print "maxdelta:" maxdelta
print "count:", count;
if (mindelta < 0.180) exit(1);
if (count < 20) exit(1);
}' ns2/named.run > awk.out.ns2.test$n || ret=1
[ $ret = 0 ] || echo_i "failed"
status=`expr $ret + $status`
......
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