Bugzilla – Bug 1155
problem w/ automated test 04-checkconf (minor)
Last modified: 2016-11-21 14:52:48 CET
The following sequence, starting at line 58:
$PRE/unbound-checkconf warn.algo 2>&1 | tee outfile
if test $? != 0; then
echo "wrong exit code, warning should not fail with error"
is not going to work as expected. The status code that's being tested is going to reflect the status of the last command in the pipeline (tee), and not the status of the unbound-checkconf utility, which is the tool under test, so the test result in some cases may be misleading.
This is indeed a bug. I fixed it by directly redirecting the output to outfile, without calling tee. And later (after testing $?) a cat of the file to send it to stdout, to keep the same behaviour as before.
Thanks for reporting!
Fix committed, closing issue.