summaryrefslogtreecommitdiffstats
path: root/bin/tests/system/dyndb
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/dyndb
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/dyndb')
-rw-r--r--bin/tests/system/dyndb/driver/Makefile.in2
-rw-r--r--bin/tests/system/dyndb/prereq.sh6
-rw-r--r--bin/tests/system/dyndb/tests.sh150
3 files changed, 77 insertions, 81 deletions
diff --git a/bin/tests/system/dyndb/driver/Makefile.in b/bin/tests/system/dyndb/driver/Makefile.in
index ccfad1d..d760fb2 100644
--- a/bin/tests/system/dyndb/driver/Makefile.in
+++ b/bin/tests/system/dyndb/driver/Makefile.in
@@ -103,11 +103,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/ax_gcc_func_attribute.m4 \
$(top_srcdir)/m4/ax_jemalloc.m4 \
$(top_srcdir)/m4/ax_lib_lmdb.m4 \
- $(top_srcdir)/m4/ax_perl_module.m4 \
$(top_srcdir)/m4/ax_posix_shell.m4 \
$(top_srcdir)/m4/ax_prog_cc_for_build.m4 \
$(top_srcdir)/m4/ax_pthread.m4 \
- $(top_srcdir)/m4/ax_python_module.m4 \
$(top_srcdir)/m4/ax_restore_flags.m4 \
$(top_srcdir)/m4/ax_save_flags.m4 $(top_srcdir)/m4/ax_tls.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
diff --git a/bin/tests/system/dyndb/prereq.sh b/bin/tests/system/dyndb/prereq.sh
index 19e0467..3bab2a6 100644
--- a/bin/tests/system/dyndb/prereq.sh
+++ b/bin/tests/system/dyndb/prereq.sh
@@ -13,9 +13,9 @@
. ../conf.sh
-$FEATURETEST --tsan && {
- echo_i "TSAN - skipping dyndb test"
- exit 255
+$FEATURETEST --tsan && {
+ echo_i "TSAN - skipping dyndb test"
+ exit 255
}
exit 0
diff --git a/bin/tests/system/dyndb/tests.sh b/bin/tests/system/dyndb/tests.sh
index ef02dea..dc6c3d0 100644
--- a/bin/tests/system/dyndb/tests.sh
+++ b/bin/tests/system/dyndb/tests.sh
@@ -19,102 +19,100 @@ status=0
n=0
DIGOPTS="@10.53.0.1 -p ${PORT}"
-RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
+RNDCCMD="$RNDC -c ../_common/rndc.conf -p ${CONTROLPORT} -s"
newtest() {
- n=$((n + 1))
- echo_i "${1} (${n})"
- ret=0
+ n=$((n + 1))
+ echo_i "${1} (${n})"
+ ret=0
}
test_add() {
- host="$1"
- type="$2"
- ip="$3"
+ host="$1"
+ type="$2"
+ ip="$3"
- cat <<EOF > ns1/update.txt
+ cat <<EOF >ns1/update.txt
server 10.53.0.1 ${PORT}
ttl 86400
update add $host $type $ip
send
EOF
- newtest "adding $host $type $ip"
- $NSUPDATE ns1/update.txt > /dev/null 2>&1 || {
- [ "$should_fail" ] || \
- echo_i "update failed for $host $type $ip"
- return 1
- }
-
- out=$($DIG $DIGOPTS +noall +answer -t $type -q $host)
- echo $out > added.a.out.$n
- lines=$(echo "$out" | grep "$ip" | wc -l)
- [ $lines -eq 1 ] || {
- [ "$should_fail" ] || \
- echo_i "dig output incorrect for $host $type $cmd: $out"
- return 1
- }
-
- for i in 1 2 3 4 5 6 7 8 9 10
- do
- out=$($DIG $DIGOPTS +noall +answer -x $ip)
- echo $out > added.ptr.out.$n
- lines=$(echo "$out" | grep "$host" | wc -l)
- [ $lines -eq 1 ] && break;
- $PERL -e 'select(undef, undef, undef, 0.1);'
- done
- [ $lines -eq 1 ] || {
- [ "$should_fail" ] || \
- echo_i "dig reverse output incorrect for $host $type $cmd: $out"
- return 1
- }
-
- return 0
+ newtest "adding $host $type $ip"
+ $NSUPDATE ns1/update.txt >/dev/null 2>&1 || {
+ [ "$should_fail" ] \
+ || echo_i "update failed for $host $type $ip"
+ return 1
+ }
+
+ out=$($DIG $DIGOPTS +noall +answer -t $type -q $host)
+ echo $out >added.a.out.$n
+ lines=$(echo "$out" | grep "$ip" | wc -l)
+ [ $lines -eq 1 ] || {
+ [ "$should_fail" ] \
+ || echo_i "dig output incorrect for $host $type $cmd: $out"
+ return 1
+ }
+
+ for i in 1 2 3 4 5 6 7 8 9 10; do
+ out=$($DIG $DIGOPTS +noall +answer -x $ip)
+ echo $out >added.ptr.out.$n
+ lines=$(echo "$out" | grep "$host" | wc -l)
+ [ $lines -eq 1 ] && break
+ $PERL -e 'select(undef, undef, undef, 0.1);'
+ done
+ [ $lines -eq 1 ] || {
+ [ "$should_fail" ] \
+ || echo_i "dig reverse output incorrect for $host $type $cmd: $out"
+ return 1
+ }
+
+ return 0
}
test_del() {
- host="$1"
- type="$2"
+ host="$1"
+ type="$2"
- ip=$($DIG $DIGOPTS +short $host $type)
+ ip=$($DIG $DIGOPTS +short $host $type)
- cat <<EOF > ns1/update.txt
+ cat <<EOF >ns1/update.txt
server 10.53.0.1 ${PORT}
update del $host $type
send
EOF
- newtest "deleting $host $type (was $ip)"
- $NSUPDATE ns1/update.txt > /dev/null 2>&1 || {
- [ "$should_fail" ] || \
- echo_i "update failed deleting $host $type"
- return 1
- }
-
- out=$($DIG $DIGOPTS +noall +answer -t $type -q $host)
- echo $out > deleted.a.out.$n
- lines=$(echo "$out" | grep "$ip" | wc -l)
- [ $lines -eq 0 ] || {
- [ "$should_fail" ] || \
- echo_i "dig output incorrect for $host $type $cmd: $out"
- return 1
- }
-
- for i in 1 2 3 4 5 6 7 8 9 10
- do
- out=$($DIG $DIGOPTS +noall +answer -x $ip)
- echo $out > deleted.ptr.out.$n
- lines=$(echo "$out" | grep "$host" | wc -l)
- [ $lines -eq 0 ] && break
- $PERL -e 'select(undef, undef, undef, 0.1);'
- done
- [ $lines -eq 0 ] || {
- [ "$should_fail" ] || \
- echo_i "dig reverse output incorrect for $host $type $cmd: $out"
- return 1
- }
-
- return 0
+ newtest "deleting $host $type (was $ip)"
+ $NSUPDATE ns1/update.txt >/dev/null 2>&1 || {
+ [ "$should_fail" ] \
+ || echo_i "update failed deleting $host $type"
+ return 1
+ }
+
+ out=$($DIG $DIGOPTS +noall +answer -t $type -q $host)
+ echo $out >deleted.a.out.$n
+ lines=$(echo "$out" | grep "$ip" | wc -l)
+ [ $lines -eq 0 ] || {
+ [ "$should_fail" ] \
+ || echo_i "dig output incorrect for $host $type $cmd: $out"
+ return 1
+ }
+
+ for i in 1 2 3 4 5 6 7 8 9 10; do
+ out=$($DIG $DIGOPTS +noall +answer -x $ip)
+ echo $out >deleted.ptr.out.$n
+ lines=$(echo "$out" | grep "$host" | wc -l)
+ [ $lines -eq 0 ] && break
+ $PERL -e 'select(undef, undef, undef, 0.1);'
+ done
+ [ $lines -eq 0 ] || {
+ [ "$should_fail" ] \
+ || echo_i "dig reverse output incorrect for $host $type $cmd: $out"
+ return 1
+ }
+
+ return 0
}
test_add test1.ipv4.example.nil. A "10.53.0.10" || ret=1
@@ -142,8 +140,8 @@ test_del test4.ipv6.example.nil. AAAA || ret=1
status=$((status + ret))
newtest "checking parameter logging"
-grep "loading params for dyndb 'sample' from .*named.conf:" ns1/named.run > /dev/null || ret=1
-grep "loading params for dyndb 'sample2' from .*named.conf:" ns1/named.run > /dev/null || ret=1
+grep "loading params for dyndb 'sample' from .*named.conf:" ns1/named.run >/dev/null || ret=1
+grep "loading params for dyndb 'sample2' from .*named.conf:" ns1/named.run >/dev/null || ret=1
[ $ret -eq 1 ] && echo_i "failed"
status=$((status + ret))