summaryrefslogtreecommitdiffstats
path: root/bin/tests/system/rpzrecurse/setup.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 23:51:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 23:51:28 +0000
commit754c7de1e91eeb28c6d3766900ead0c3e44fdb85 (patch)
tree51433c0e38731dc9ecd342555a56f876980b1834 /bin/tests/system/rpzrecurse/setup.sh
parentAdding debian version 1:9.16.44-1~deb11u1. (diff)
downloadbind9-754c7de1e91eeb28c6d3766900ead0c3e44fdb85.tar.xz
bind9-754c7de1e91eeb28c6d3766900ead0c3e44fdb85.zip
Merging upstream version 1:9.16.48.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'bin/tests/system/rpzrecurse/setup.sh')
-rw-r--r--bin/tests/system/rpzrecurse/setup.sh64
1 files changed, 34 insertions, 30 deletions
diff --git a/bin/tests/system/rpzrecurse/setup.sh b/bin/tests/system/rpzrecurse/setup.sh
index 7c15414..27234c8 100644
--- a/bin/tests/system/rpzrecurse/setup.sh
+++ b/bin/tests/system/rpzrecurse/setup.sh
@@ -21,17 +21,23 @@ SYSTEMTESTTOP=..
USAGE="$0: [-DNx]"
DEBUG=
while getopts "DNx" c; do
- case $c in
- x) set -x; DEBUG=-x;;
- D) TEST_DNSRPS="-D";;
- N) NOCLEAN=set;;
- *) echo "$USAGE" 1>&2; exit 1;;
- esac
+ case $c in
+ x)
+ set -x
+ DEBUG=-x
+ ;;
+ D) TEST_DNSRPS="-D" ;;
+ N) NOCLEAN=set ;;
+ *)
+ echo "$USAGE" 1>&2
+ exit 1
+ ;;
+ esac
done
-shift `expr $OPTIND - 1 || true`
+shift $(expr $OPTIND - 1 || true)
if test "$#" -ne 0; then
- echo "$USAGE" 1>&2
- exit 1
+ echo "$USAGE" 1>&2
+ exit 1
fi
[ ${NOCLEAN:-unset} = unset ] && $SHELL clean.sh $DEBUG
@@ -50,40 +56,38 @@ copy_setports ns4/named.conf.in ns4/named.conf
# setup policy zones for a 64-zone test
i=1
-while test $i -le 64
-do
- echo "\$TTL 60" > ns2/db.max$i.local
- echo "@ IN SOA root.ns ns 1996072700 3600 1800 86400 60" >> ns2/db.max$i.local
- echo " NS ns" >> ns2/db.max$i.local
- echo "ns A 127.0.0.1" >> ns2/db.max$i.local
-
- j=1
- while test $j -le $i
- do
- echo "name$j A 10.53.0.$i" >> ns2/db.max$i.local
- j=`expr $j + 1`
- done
- i=`expr $i + 1`
+while test $i -le 64; do
+ echo "\$TTL 60" >ns2/db.max$i.local
+ echo "@ IN SOA root.ns ns 1996072700 3600 1800 86400 60" >>ns2/db.max$i.local
+ echo " NS ns" >>ns2/db.max$i.local
+ echo "ns A 127.0.0.1" >>ns2/db.max$i.local
+
+ j=1
+ while test $j -le $i; do
+ echo "name$j A 10.53.0.$i" >>ns2/db.max$i.local
+ j=$(expr $j + 1)
+ done
+ i=$(expr $i + 1)
done
# decide whether to test DNSRPS
$SHELL ../ckdnsrps.sh $TEST_DNSRPS $DEBUG
-test -z "`grep 'dnsrps-enable yes' dnsrps.conf`" && TEST_DNSRPS=
+test -z "$(grep 'dnsrps-enable yes' dnsrps.conf)" && TEST_DNSRPS=
-CWD=`pwd`
+CWD=$(pwd)
cat <<EOF >dnsrpzd.conf
PID-FILE $CWD/dnsrpzd.pid;
include $CWD/dnsrpzd-license-cur.conf
-zone "policy" { type master; file "`pwd`/ns3/policy.db"; };
+zone "policy" { type master; file "$(pwd)/ns3/policy.db"; };
EOF
sed -n -e 's/^ *//' -e "/zone.*.*master/s@file \"@&$CWD/ns2/@p" ns2/*.conf \
- >>dnsrpzd.conf
+ >>dnsrpzd.conf
# Run dnsrpzd to get the license and prime the static policy zones
if test -n "$TEST_DNSRPS"; then
- DNSRPZD="`../rpz/dnsrps -p`"
- "$DNSRPZD" -D./dnsrpzd.rpzf -S./dnsrpzd.sock -C./dnsrpzd.conf \
- -w 0 -dddd -L stdout >./dnsrpzd.run 2>&1
+ DNSRPZD="$(../rpz/dnsrps -p)"
+ "$DNSRPZD" -D./dnsrpzd.rpzf -S./dnsrpzd.sock -C./dnsrpzd.conf \
+ -w 0 -dddd -L stdout >./dnsrpzd.run 2>&1
fi