From 73d64de779f262cc63f1029470457002abf23403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 28 Jun 2018 13:38:39 +0200 Subject: [PATCH] Make "rndc zonestatus" output for mirror zones different than for regular slave zones Replace "type: slave" with "type: mirror" in "rndc zonestatus" output for mirror zones in order to enable the user to tell a regular slave zone and a mirror zone apart. --- bin/named/server.c | 2 +- bin/tests/system/mirror/clean.sh | 1 + bin/tests/system/mirror/tests.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/named/server.c b/bin/named/server.c index 20151d3563..22b483123e 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -13849,7 +13849,7 @@ named_server_zonestatus(named_server_t *server, isc_lex_t *lex, type = "master"; break; case dns_zone_slave: - type = "slave"; + type = dns_zone_ismirror(zone) ? "mirror" : "slave"; break; case dns_zone_stub: type = "stub"; diff --git a/bin/tests/system/mirror/clean.sh b/bin/tests/system/mirror/clean.sh index 1c98ed6d3c..3f45916958 100644 --- a/bin/tests/system/mirror/clean.sh +++ b/bin/tests/system/mirror/clean.sh @@ -20,3 +20,4 @@ rm -f */jn-* rm -f */named.memstats rm -f */named.run rm -f dig.out.* +rm -f rndc.out.* diff --git a/bin/tests/system/mirror/tests.sh b/bin/tests/system/mirror/tests.sh index 797610f0d2..c82da3e095 100644 --- a/bin/tests/system/mirror/tests.sh +++ b/bin/tests/system/mirror/tests.sh @@ -354,5 +354,13 @@ grep "initially-unavailable.*sending notifies" ns3/named.run > /dev/null && ret= if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` +n=`expr $n + 1` +echo_i "checking output of \"rndc zonestatus\" for a mirror zone ($n)" +ret=0 +$RNDCCMD 10.53.0.3 zonestatus . > rndc.out.ns3.test$n 2>&1 +grep "type: mirror" rndc.out.ns3.test$n > /dev/null || ret=1 +if [ $ret != 0 ]; then echo_i "failed"; fi +status=`expr $status + $ret` + echo_i "exit status: $status" [ $status -eq 0 ] || exit 1