rndc reconfig reports configuration errors the same way rndc reload does [RT #39635]

This commit is contained in:
Witold Krecicki
2015-06-12 10:19:29 +02:00
parent ed2fcdc27f
commit ece6e87818
5 changed files with 36 additions and 25 deletions

View File

@@ -275,5 +275,20 @@ grep "query: foo9876.bind CH TXT" ns3/named.run > /dev/null && ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:test 'rndc reconfig' with a broken config"
ret=0
$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reconfig > /dev/null || ret=1
sleep 1
mv ns3/named.conf ns3/named.conf.save
echo "error error error" >> ns3/named.conf
$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reconfig > rndc.output 2>&1 && ret=1
grep "rndc: 'reconfig' failed: unexpected token" rndc.output > /dev/null || ret=1
mv ns3/named.conf.save ns3/named.conf
sleep 1
$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf reconfig > /dev/null || ret=1
sleep 1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:exit status: $status"
exit $status