summaryrefslogtreecommitdiffstats
path: root/bin/tests/system/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'bin/tests/system/builtin')
-rw-r--r--bin/tests/system/builtin/tests.sh177
1 files changed, 108 insertions, 69 deletions
diff --git a/bin/tests/system/builtin/tests.sh b/bin/tests/system/builtin/tests.sh
index 416b792..bf6eef0 100644
--- a/bin/tests/system/builtin/tests.sh
+++ b/bin/tests/system/builtin/tests.sh
@@ -121,127 +121,166 @@ B.E.F.IP6.ARPA
EMPTY.AS112.ARPA
HOME.ARPA"
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
count=0
echo_i "Checking expected empty zones were configured ($n)"
-for zone in ${emptyzones}
-do
- grep "automatic empty zone: $zone" ns1/named.run > /dev/null || {
- echo_i "failed (empty zone $zone missing)"
- ret=1
- }
- count=`expr $count + 1`
+for zone in ${emptyzones}; do
+ grep "automatic empty zone: $zone" ns1/named.run >/dev/null || {
+ echo_i "failed (empty zone $zone missing)"
+ ret=1
+ }
+ count=$(expr $count + 1)
done
-lines=`grep "automatic empty zone: " ns1/named.run | wc -l`
+lines=$(grep "automatic empty zone: " ns1/named.run | wc -l)
test $count -eq $lines -a $count -eq 99 || {
- ret=1; echo_i "failed (count mismatch)";
+ ret=1
+ echo_i "failed (count mismatch)"
}
-if [ $ret != 0 ] ; then status=`expr $status + $ret`; fi
+if [ $ret != 0 ]; then status=$(expr $status + $ret); fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
echo_i "Checking that reconfiguring empty zones is silent ($n)"
$RNDCCMD 10.53.0.1 reconfig
ret=0
-grep "automatic empty zone" ns1/named.run > /dev/null || ret=1
-grep "received control channel command 'reconfig'" ns1/named.run > /dev/null || ret=1
-grep "reloading configuration succeeded" ns1/named.run > /dev/null || ret=1
+grep "automatic empty zone" ns1/named.run >/dev/null || ret=1
+grep "received control channel command 'reconfig'" ns1/named.run >/dev/null || ret=1
+grep "reloading configuration succeeded" ns1/named.run >/dev/null || ret=1
sleep 1
-grep "zone serial (0) unchanged." ns1/named.run > /dev/null && ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+grep "zone serial (0) unchanged." ns1/named.run >/dev/null && ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
echo_i "Checking that reloading empty zones is silent ($n)"
rndc_reload ns1 10.53.0.1
ret=0
-grep "automatic empty zone" ns1/named.run > /dev/null || ret=1
-grep "received control channel command 'reload'" ns1/named.run > /dev/null || ret=1
-grep "reloading configuration succeeded" ns1/named.run > /dev/null || ret=1
+grep "automatic empty zone" ns1/named.run >/dev/null || ret=1
+grep "received control channel command 'reload'" ns1/named.run >/dev/null || ret=1
+grep "reloading configuration succeeded" ns1/named.run >/dev/null || ret=1
sleep 1
-grep "zone serial (0) unchanged." ns1/named.run > /dev/null && ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+grep "zone serial (0) unchanged." ns1/named.run >/dev/null && ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-HOST_NAME=`$FEATURETEST --gethostname`
+HOST_NAME=$($FEATURETEST --gethostname)
BIND_VERSION_STRING=$($NAMED -V | head -1)
BIND_VERSION=$($NAMED -V | sed -ne 's/^BIND \([^ ]*\).*/\1/p')
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that default version works for rndc ($n)"
-$RNDCCMD 10.53.0.1 status > rndc.status.ns1.$n 2>&1
-grep -F "version: $BIND_VERSION_STRING" rndc.status.ns1.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$RNDCCMD 10.53.0.1 status >rndc.status.ns1.$n 2>&1
+grep -F "version: $BIND_VERSION_STRING" rndc.status.ns1.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that custom version works for rndc ($n)"
-$RNDCCMD 10.53.0.3 status > rndc.status.ns3.$n 2>&1
-grep -F "version: $BIND_VERSION_STRING (this is a test of version)" rndc.status.ns3.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$RNDCCMD 10.53.0.3 status >rndc.status.ns3.$n 2>&1
+grep -F "version: $BIND_VERSION_STRING (this is a test of version)" rndc.status.ns3.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that default version works for query ($n)"
-$DIG $DIGOPTS +short version.bind txt ch @10.53.0.1 > dig.out.ns1.$n
-grep "^\"$BIND_VERSION\"$" dig.out.ns1.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +short version.bind txt ch @10.53.0.1 >dig.out.ns1.$n
+grep "^\"$BIND_VERSION\"$" dig.out.ns1.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that custom version works for query ($n)"
-$DIG $DIGOPTS +short version.bind txt ch @10.53.0.3 > dig.out.ns3.$n
-grep "^\"this is a test of version\"$" dig.out.ns3.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +short version.bind txt ch @10.53.0.3 >dig.out.ns3.$n
+grep "^\"this is a test of version\"$" dig.out.ns3.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that default hostname works for query ($n)"
-$DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.1 > dig.out.ns1.$n
-grep "^\"$HOST_NAME\"$" dig.out.ns1.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.1 >dig.out.ns1.$n
+grep "^\"$HOST_NAME\"$" dig.out.ns1.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that custom hostname works for query ($n)"
-$DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.3 > dig.out.ns3.$n
-grep "^\"this.is.a.test.of.hostname\"$" dig.out.ns3.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +short hostname.bind txt ch @10.53.0.3 >dig.out.ns3.$n
+grep "^\"this.is.a.test.of.hostname\"$" dig.out.ns3.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that default server-id is none for query ($n)"
-$DIG $DIGOPTS id.server txt ch @10.53.0.1 > dig.out.ns1.$n
-grep "status: NOERROR" dig.out.ns1.$n > /dev/null || ret=1
-grep "ANSWER: 0" dig.out.ns1.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS id.server txt ch @10.53.0.1 >dig.out.ns1.$n
+grep "status: NOERROR" dig.out.ns1.$n >/dev/null || ret=1
+grep "ANSWER: 0" dig.out.ns1.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that server-id hostname works for query ($n)"
-$DIG $DIGOPTS +short id.server txt ch @10.53.0.2 > dig.out.ns2.$n
-grep "^\"$HOST_NAME\"$" dig.out.ns2.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +short id.server txt ch @10.53.0.2 >dig.out.ns2.$n
+grep "^\"$HOST_NAME\"$" dig.out.ns2.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that server-id hostname works for EDNS name server ID request ($n)"
-$DIG $DIGOPTS +norec +nsid foo @10.53.0.2 > dig.out.ns2.$n
-grep "^; NSID: .* (\"$HOST_NAME\")$" dig.out.ns2.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +norec +nsid foo @10.53.0.2 >dig.out.ns2.$n
+grep "^; NSID: .* (\"$HOST_NAME\")$" dig.out.ns2.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that custom server-id works for query ($n)"
-$DIG $DIGOPTS +short id.server txt ch @10.53.0.3 > dig.out.ns3.$n
-grep "^\"this.is.a.test.of.server-id\"$" dig.out.ns3.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +short id.server txt ch @10.53.0.3 >dig.out.ns3.$n
+grep "^\"this.is.a.test.of.server-id\"$" dig.out.ns3.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
-n=`expr $n + 1`
+n=$(expr $n + 1)
ret=0
echo_i "Checking that custom server-id works for EDNS name server ID request ($n)"
-$DIG $DIGOPTS +norec +nsid foo @10.53.0.3 > dig.out.ns3.$n
-grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" dig.out.ns3.$n > /dev/null || ret=1
-if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi
+$DIG $DIGOPTS +norec +nsid foo @10.53.0.3 >dig.out.ns3.$n
+grep "^; NSID: .* (\"this.is.a.test.of.server-id\")$" dig.out.ns3.$n >/dev/null || ret=1
+if [ $ret != 0 ]; then
+ echo_i "failed"
+ status=$(expr $status + $ret)
+fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1