Commit e7b8c9b4 authored by Evan Hunt's avatar Evan Hunt

Merge branch 'each-mdig-multi-norrcomments-v9_14' into 'v9_14'

minor bugfix in mdig: when using +multi, +norrcomments was ignored

See merge request isc-projects/bind9!2240
parents 13f4c3b5 81312bcf
......@@ -109,19 +109,19 @@ if [ -x "$DIG" ] ; then
status=$((status+ret))
n=$((n+1))
echo_i "checking dig +multi +norrcomments works for dnskey (when default is rrcomments)($n)"
echo_i "checking dig +multi +norrcomments works for DNSKEY (when default is rrcomments)($n)"
ret=0
dig_with_opts +tcp @10.53.0.3 +multi +norrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1
grep "; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID" < dig.out.test$n > /dev/null && ret=1
dig_with_opts +tcp @10.53.0.3 +multi +norrcomments -t DNSKEY dnskey.example > dig.out.test$n || ret=1
grep "; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID" dig.out.test$n > /dev/null && ret=1
check_ttl_range dig.out.test$n "DNSKEY" 300 || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking dig +multi +norrcomments works for soa (when default is rrcomments)($n)"
echo_i "checking dig +multi +norrcomments works for SOA (when default is rrcomments)($n)"
ret=0
dig_with_opts +tcp @10.53.0.3 +multi +norrcomments SOA example > dig.out.test$n || ret=1
grep "; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID" < dig.out.test$n > /dev/null && ret=1
dig_with_opts +tcp @10.53.0.3 +multi +norrcomments -t SOA example > dig.out.test$n || ret=1
grep "; serial" dig.out.test$n > /dev/null && ret=1
check_ttl_range dig.out.test$n "SOA" 300 || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
......@@ -696,6 +696,22 @@ if [ -x "$MDIG" ] ; then
grep "ednsopt no code point specified" dig.out.test$n > /dev/null || ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking mdig +multi +norrcomments works for DNSKEY (when default is rrcomments)($n)"
ret=0
mdig_with_opts +tcp @10.53.0.3 +multi +norrcomments -t DNSKEY dnskey.example > dig.out.test$n || ret=1
grep "; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID" dig.out.test$n && ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "checking mdig +multi +norrcomments works for SOA (when default is rrcomments)($n)"
ret=0
mdig_with_opts +tcp @10.53.0.3 +multi +norrcomments -t SOA example > dig.out.test$n || ret=1
grep "; serial" < dig.out.test$n > /dev/null && ret=1
if [ $ret -ne 0 ]; then echo_i "failed"; fi
status=$((status+ret))
else
echo_i "$MDIG is needed, so skipping these mdig tests"
fi
......@@ -791,7 +807,7 @@ if [ -x "$DELV" ] ; then
status=$((status+ret))
n=$((n+1))
echo_i "checking delv +multi +norrcomments works for dnskey (when default is rrcomments)($n)"
echo_i "checking delv +multi +norrcomments works for DNSKEY (when default is rrcomments)($n)"
ret=0
delv_with_opts +tcp @10.53.0.3 +multi +norrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1
grep "; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID" < delv.out.test$n > /dev/null && ret=1
......@@ -800,7 +816,7 @@ if [ -x "$DELV" ] ; then
status=$((status+ret))
n=$((n+1))
echo_i "checking delv +multi +norrcomments works for soa (when default is rrcomments)($n)"
echo_i "checking delv +multi +norrcomments works for SOA (when default is rrcomments)($n)"
ret=0
delv_with_opts +tcp @10.53.0.3 +multi +norrcomments SOA example > delv.out.test$n || ret=1
grep "; ZSK; alg = $DEFAULT_ALGORITHM ; key id = $KEYID" < delv.out.test$n > /dev/null && ret=1
......
......@@ -96,7 +96,7 @@ static bool besteffort = true;
static bool display_short_form = false;
static bool display_headers = true;
static bool display_comments = true;
static bool display_rrcomments = true;
static int display_rrcomments = 0;
static bool display_ttlunits = true;
static bool display_ttl = true;
static bool display_class = true;
......@@ -249,7 +249,7 @@ recvresponse(isc_task_t *task, isc_event_t *event) {
styleflags |= DNS_STYLEFLAG_COMMENT;
if (display_unknown_format)
styleflags |= DNS_STYLEFLAG_UNKNOWNFORMAT;
if (display_rrcomments)
if (display_rrcomments > 0)
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
if (display_ttlunits)
styleflags |= DNS_STYLEFLAG_TTL_UNITS;
......@@ -267,7 +267,10 @@ recvresponse(isc_task_t *task, isc_event_t *event) {
styleflags |= DNS_STYLEFLAG_TTL;
styleflags |= DNS_STYLEFLAG_MULTILINE;
styleflags |= DNS_STYLEFLAG_COMMENT;
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
/* Turn on rrcomments unless explicitly disabled */
if (display_rrcomments >= 0) {
styleflags |= DNS_STYLEFLAG_RRCOMMENT;
}
}
if (display_multiline || (!display_ttl && !display_class))
result = dns_master_stylecreate(&style, styleflags,
......@@ -1109,7 +1112,7 @@ plus_option(char *option, struct query *query, bool global)
display_authority = state;
display_additional = state;
display_comments = state;
display_rrcomments = state;
display_rrcomments = state ? 1 : -1;
break;
case 'n': /* answer */
FULLCHECK("answer");
......@@ -1358,7 +1361,7 @@ plus_option(char *option, struct query *query, bool global)
case 'r':
FULLCHECK("rrcomments");
GLOBAL();
display_rrcomments = state;
display_rrcomments = state ? 1 : -1;
break;
default:
goto invalid_option;
......@@ -1376,7 +1379,7 @@ plus_option(char *option, struct query *query, bool global)
display_authority = false;
display_additional = false;
display_comments = false;
display_rrcomments = false;
display_rrcomments = -1;
}
break;
case 'p': /* split */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment