]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix invalid control port number in the catz system test
authorAram Sargsyan <aram@isc.org>
Tue, 4 Jan 2022 17:22:32 +0000 (17:22 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 25 Jan 2022 08:21:50 +0000 (08:21 +0000)
When failure is expected, the `rndc` command in the catz system test
is being called directly instead of using a function, i.e.:

    $RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig \
        > /dev/null 2>&1 && ret=1

... instead of:

    rndccmd 10.53.0.2 reconfig && ret=1

This is done to suppress messages like "lt-rndc: 'reconfig' failed:
failure" appearing in the message log of the test, because failure
is actually expected, and the appearance of that message can be
confusing.

The port value used in this case is not correct, making the
`rndc reload` command to fail.  This error was not detected earlier
only because the failure of the command is actually expected, but
the failure happens for a "wrong" reason, and the test still passes.

Fix the error by using the existing variable instead of the fixed
number.

bin/tests/system/catz/tests.sh

index 9dd2ec33b1cb1149dbbe8f63d746317174d24f47..469acdcdb9a8f94a4a5eddae781da2a09574b3ff 100644 (file)
@@ -1237,7 +1237,7 @@ echo_i "reconfiguring secondary - removing catalog4 catalog zone, adding non-exi
 ret=0
 sed -e "s/^#T2//" < ns2/named1.conf.in > ns2/named.conf.tmp
 copy_setports ns2/named.conf.tmp ns2/named.conf
-$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig > /dev/null 2>&1 && ret=1
+$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p "${CONTROLPORT}" reconfig > /dev/null 2>&1 && ret=1
 if [ $ret -ne 0 ]; then echo_i "failed"; fi
 status=$((status+ret))