summaryrefslogtreecommitdiffstats
path: root/bin/tests/system/journal
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 16:41:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 16:41:29 +0000
commite2fc8e037ea6bb5de92b25ec9c12a624737ac5ca (patch)
tree65e6bbf5e12c3fe09b43e577f8d1786d06bcd559 /bin/tests/system/journal
parentReleasing progress-linux version 1:9.18.19-1~deb12u1progress7u1. (diff)
downloadbind9-e2fc8e037ea6bb5de92b25ec9c12a624737ac5ca.tar.xz
bind9-e2fc8e037ea6bb5de92b25ec9c12a624737ac5ca.zip
Merging upstream version 1:9.18.24.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/tests/system/journal')
-rw-r--r--bin/tests/system/journal/setup.sh2
-rw-r--r--bin/tests/system/journal/tests.sh106
2 files changed, 53 insertions, 55 deletions
diff --git a/bin/tests/system/journal/setup.sh b/bin/tests/system/journal/setup.sh
index e9b0072..6017f1c 100644
--- a/bin/tests/system/journal/setup.sh
+++ b/bin/tests/system/journal/setup.sh
@@ -44,7 +44,7 @@ cp ns1/generic.db.in ns1/maxjournal2.db
cp ns1/maxjournal2.jnl.saved ns1/maxjournal2.db.jnl
cp ns1/managed-keys.bind.in ns1/managed-keys.bind
-$PERL ../fromhex.pl < ns1/managed-keys.bind.jnl.in > ns1/managed-keys.bind.jnl
+$PERL ../fromhex.pl <ns1/managed-keys.bind.jnl.in >ns1/managed-keys.bind.jnl
copy_setports ns2/named.conf.in ns2/named.conf
cp ns2/managed-keys.bind.in ns2/managed-keys.bind
diff --git a/bin/tests/system/journal/tests.sh b/bin/tests/system/journal/tests.sh
index 5dbceb8..79b90ba 100644
--- a/bin/tests/system/journal/tests.sh
+++ b/bin/tests/system/journal/tests.sh
@@ -16,11 +16,11 @@ set -e
. ../conf.sh
dig_with_opts() {
- "$DIG" @10.53.0.1 -p "$PORT" +tcp "$@"
+ "$DIG" @10.53.0.1 -p "$PORT" +tcp "$@"
}
rndc_with_opts() {
- "$RNDC" -c ../common/rndc.conf -p "$CONTROLPORT" -s "$@"
+ "$RNDC" -c ../_common/rndc.conf -p "$CONTROLPORT" -s "$@"
}
status=0
@@ -29,26 +29,26 @@ n=0
n=$((n + 1))
echo_i "check outdated journal rolled forward (dynamic) ($n)"
ret=0
-dig_with_opts changed soa > dig.out.test$n
-grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
-grep '2012010902' dig.out.test$n > /dev/null || ret=1
-grep 'zone changed/IN: journal rollforward completed successfully using old journal format' ns1/named.run > /dev/null || ret=1
+dig_with_opts changed soa >dig.out.test$n
+grep 'status: NOERROR' dig.out.test$n >/dev/null || ret=1
+grep '2012010902' dig.out.test$n >/dev/null || ret=1
+grep 'zone changed/IN: journal rollforward completed successfully using old journal format' ns1/named.run >/dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
n=$((n + 1))
echo_i "check outdated empty journal did not cause an error (dynamic) ($n)"
ret=0
-dig_with_opts unchanged soa > dig.out.test$n
-grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
-grep '2012010901' dig.out.test$n > /dev/null || ret=1
+dig_with_opts unchanged soa >dig.out.test$n
+grep 'status: NOERROR' dig.out.test$n >/dev/null || ret=1
+grep '2012010901' dig.out.test$n >/dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
n=$((n + 1))
echo_i "check outdated journals were updated or removed (dynamic) ($n)"
ret=0
-cat -v ns1/changed.db.jnl | grep "BIND LOG V9.2" > /dev/null || ret=1
+cat -v ns1/changed.db.jnl | grep "BIND LOG V9.2" >/dev/null || ret=1
[ -f ns1/unchanged.db.jnl ] && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
@@ -56,36 +56,36 @@ status=$((status + ret))
n=$((n + 1))
echo_i "check updated journal has correct RR count (dynamic) ($n)"
ret=0
-$JOURNALPRINT -x ns1/changed.db.jnl | grep "rrcount 3 " > /dev/null || ret=1
+$JOURNALPRINT -x ns1/changed.db.jnl | grep "rrcount 3 " >/dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
n=$((n + 1))
echo_i "check new-format journal rolled forward (dynamic) ($n)"
ret=0
-dig_with_opts changed2 soa > dig.out.test$n
-grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
-grep '2012010902' dig.out.test$n > /dev/null || ret=1
-grep 'zone changed2/IN: journal rollforward completed successfully: success' ns1/named.run > /dev/null || ret=1
-grep 'zone changed2/IN: journal rollforward completed successfully using old journal format' ns1/named.run > /dev/null && ret=1
+dig_with_opts changed2 soa >dig.out.test$n
+grep 'status: NOERROR' dig.out.test$n >/dev/null || ret=1
+grep '2012010902' dig.out.test$n >/dev/null || ret=1
+grep 'zone changed2/IN: journal rollforward completed successfully: success' ns1/named.run >/dev/null || ret=1
+grep 'zone changed2/IN: journal rollforward completed successfully using old journal format' ns1/named.run >/dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
n=$((n + 1))
echo_i "check new-format empty journal did not cause error (dynamic) ($n)"
ret=0
-dig_with_opts unchanged2 soa > dig.out.test$n
-grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
-grep '2012010901' dig.out.test$n > /dev/null || ret=1
-grep 'zone unchanged2/IN: journal rollforward completed successfully' ns1/named.run > /dev/null && ret=1
-grep 'zone unchanged2/IN: journal rollforward completed successfully using old journal format' ns1/named.run > /dev/null && ret=1
+dig_with_opts unchanged2 soa >dig.out.test$n
+grep 'status: NOERROR' dig.out.test$n >/dev/null || ret=1
+grep '2012010901' dig.out.test$n >/dev/null || ret=1
+grep 'zone unchanged2/IN: journal rollforward completed successfully' ns1/named.run >/dev/null && ret=1
+grep 'zone unchanged2/IN: journal rollforward completed successfully using old journal format' ns1/named.run >/dev/null && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
n=$((n + 1))
echo_i "check new-format journals were updated or removed (dynamic) ($n)"
ret=0
-cat -v ns1/changed2.db.jnl | grep "BIND LOG V9.2" > /dev/null || ret=1
+cat -v ns1/changed2.db.jnl | grep "BIND LOG V9.2" >/dev/null || ret=1
[ -f ns1/unchanged2.db.jnl ] && ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
@@ -93,29 +93,29 @@ status=$((status + ret))
n=$((n + 1))
echo_i "check outdated up-to-date journal succeeded (ixfr-from-differences) ($n)"
ret=0
-dig_with_opts -t soa ixfr > dig.out.test$n
-grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
-grep '2012010902' dig.out.test$n > /dev/null || ret=1
-grep 'zone ixfr/IN: journal rollforward completed successfully using old journal format: up to date' ns1/named.run > /dev/null || ret=1
+dig_with_opts -t soa ixfr >dig.out.test$n
+grep 'status: NOERROR' dig.out.test$n >/dev/null || ret=1
+grep '2012010902' dig.out.test$n >/dev/null || ret=1
+grep 'zone ixfr/IN: journal rollforward completed successfully using old journal format: up to date' ns1/named.run >/dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
n=$((n + 1))
echo_i "check outdated journal was updated (ixfr-from-differences) ($n)"
ret=0
-cat -v ns1/ixfr.db.jnl | grep "BIND LOG V9.2" > /dev/null || ret=1
+cat -v ns1/ixfr.db.jnl | grep "BIND LOG V9.2" >/dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
n=$((n + 1))
echo_i "check journal with mixed headers succeeded (version 1,2,1,2) ($n)"
ret=0
-dig_with_opts -t soa hdr1d1d2d1d2 > dig.out.test$n
-grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
-grep '2012010905' dig.out.test$n > /dev/null || ret=1
-grep 'zone hdr1d1d2d1d2/IN: journal rollforward completed successfully using old journal format: success' ns1/named.run > /dev/null || ret=1
-grep 'zone_journal_compact: zone hdr1d1d2d1d2/IN: repair full journal' ns1/named.run > /dev/null || ret=1
-grep 'hdr1d1d2d1d2/IN: dns_journal_compact: success' ns1/named.run > /dev/null || ret=1
+dig_with_opts -t soa hdr1d1d2d1d2 >dig.out.test$n
+grep 'status: NOERROR' dig.out.test$n >/dev/null || ret=1
+grep '2012010905' dig.out.test$n >/dev/null || ret=1
+grep 'zone hdr1d1d2d1d2/IN: journal rollforward completed successfully using old journal format: success' ns1/named.run >/dev/null || ret=1
+grep 'zone_journal_compact: zone hdr1d1d2d1d2/IN: repair full journal' ns1/named.run >/dev/null || ret=1
+grep 'hdr1d1d2d1d2/IN: dns_journal_compact: success' ns1/named.run >/dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
@@ -132,12 +132,12 @@ status=$((status + ret))
n=$((n + 1))
echo_i "check journal with mixed headers succeeded (version 2,1,2,1) ($n)"
ret=0
-dig_with_opts -t soa hdr1d2d1d2d1 > dig.out.test$n
-grep 'status: NOERROR' dig.out.test$n > /dev/null || ret=1
-grep '2012010905' dig.out.test$n > /dev/null || ret=1
-grep 'zone hdr1d2d1d2d1/IN: journal rollforward completed successfully using old journal format: success' ns1/named.run > /dev/null || ret=1
-grep 'zone_journal_compact: zone hdr1d2d1d2d1/IN: repair full journal' ns1/named.run > /dev/null || ret=1
-grep 'zone hdr1d2d1d2d1/IN: dns_journal_compact: success' ns1/named.run > /dev/null || ret=1
+dig_with_opts -t soa hdr1d2d1d2d1 >dig.out.test$n
+grep 'status: NOERROR' dig.out.test$n >/dev/null || ret=1
+grep '2012010905' dig.out.test$n >/dev/null || ret=1
+grep 'zone hdr1d2d1d2d1/IN: journal rollforward completed successfully using old journal format: success' ns1/named.run >/dev/null || ret=1
+grep 'zone_journal_compact: zone hdr1d2d1d2d1/IN: repair full journal' ns1/named.run >/dev/null || ret=1
+grep 'zone hdr1d2d1d2d1/IN: dns_journal_compact: success' ns1/named.run >/dev/null || ret=1
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
@@ -165,10 +165,9 @@ echo_i "Check that journal with mixed headers can be compacted (version 1,2,1,2)
ret=0
journal=ns1/d1212.jnl.saved
seriallist=$($JOURNALPRINT -x $journal | awk '$1 == "Transaction:" { print $11 }')
-for serial in $seriallist
-do
- cp $journal tmp.jnl
- $JOURNALPRINT -c $serial tmp.jnl || ret=1
+for serial in $seriallist; do
+ cp $journal tmp.jnl
+ $JOURNALPRINT -c $serial tmp.jnl || ret=1
done
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
@@ -178,10 +177,9 @@ echo_i "Check that journal with mixed headers can be compacted (version 2,1,2,1)
ret=0
journal=ns1/d2121.jnl.saved
seriallist=$($JOURNALPRINT -x $journal | awk '$1 == "Transaction:" { print $11 }')
-for serial in $seriallist
-do
- cp ns1/d1212.jnl.saved tmp.jnl
- $JOURNALPRINT -c $serial tmp.jnl || ret=1
+for serial in $seriallist; do
+ cp ns1/d1212.jnl.saved tmp.jnl
+ $JOURNALPRINT -c $serial tmp.jnl || ret=1
done
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
@@ -189,7 +187,7 @@ status=$((status + ret))
n=$((n + 1))
echo_i "check upgrade of managed-keys.bind.jnl succeeded($n)"
ret=0
-$JOURNALPRINT ns1/managed-keys.bind.jnl > journalprint.out.test$n
+$JOURNALPRINT ns1/managed-keys.bind.jnl >journalprint.out.test$n
lines=$(awk '$1 == "add" && $5 == "SOA" && $8 == "3297" { print }' journalprint.out.test$n | wc -l)
test $lines -eq 1 || ret=1
[ $ret -eq 0 ] || echo_i "failed"
@@ -212,12 +210,12 @@ n=$((n + 1))
echo_i "check max-journal-size works after journal update ($n)"
ret=0
# journal was repaired, it should still be big
-[ $(wc -c < ns1/maxjournal.db.jnl) -gt 12000 ] || ret=1
+[ $(wc -c <ns1/maxjournal.db.jnl) -gt 12000 ] || ret=1
# the zone hasn't been dumped yet, so 'rndc sync' should work without
# needing a zone update first.
rndc_with_opts 10.53.0.1 sync maxjournal
check_size() (
- [ $(wc -c < ns1/maxjournal.db.jnl) -lt 4000 ]
+ [ $(wc -c <ns1/maxjournal.db.jnl) -lt 4000 ]
)
retry_quiet 10 check_size || ret=1
[ $ret -eq 0 ] || echo_i "failed"
@@ -227,12 +225,12 @@ n=$((n + 1))
echo_i "check max-journal-size works with non-updated journals ($n)"
ret=0
# journal was not repaired, so it should still be big
-[ $(wc -c < ns1/maxjournal2.db.jnl) -gt 12000 ] || ret=1
+[ $(wc -c <ns1/maxjournal2.db.jnl) -gt 12000 ] || ret=1
# the zone hasn't been dumped yet, so 'rndc sync' should work without
# needing a zone update first.
rndc_with_opts 10.53.0.1 sync maxjournal2
check_size() (
- [ $(wc -c < ns1/maxjournal2.db.jnl) -lt 4000 ]
+ [ $(wc -c <ns1/maxjournal2.db.jnl) -lt 4000 ]
)
retry_quiet 10 check_size || ret=1
[ $ret -eq 0 ] || echo_i "failed"
@@ -242,7 +240,7 @@ n=$((n + 1))
echo_i "check journal index consistency ($n)"
ret=0
for jnl in ns1/*.jnl; do
- $JOURNALPRINT -x $jnl 2>&1 | grep -q "Offset mismatch" && ret=1
+ $JOURNALPRINT -x $jnl 2>&1 | grep -q "Offset mismatch" && ret=1
done
[ $ret -eq 0 ] || echo_i "failed"
status=$((status + ret))
@@ -250,7 +248,7 @@ status=$((status + ret))
n=$((n + 1))
echo_i "check that journal is applied to zone with keydata placeholder record"
ret=0
-grep 'managed-keys-zone: journal rollforward completed successfully: up to date' ns2/named.run > /dev/null 2>&1 || ret=1
+grep 'managed-keys-zone: journal rollforward completed successfully: up to date' ns2/named.run >/dev/null 2>&1 || ret=1
[ $ret -eq 0 ] || echo_i "failed"
echo_i "exit status: $status"