Bug 1155 - problem w/ automated test 04-checkconf (minor)
problem w/ automated test 04-checkconf (minor)
Product: unbound
Classification: Unclassified
Component: server
x86_64 Linux
: P5 trivial
Assigned To: unbound team
Depends on:
  Show dependency treegraph
Reported: 2016-11-09 20:51 CET by akocmaruk
Modified: 2016-11-21 14:52 CET (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description akocmaruk 2016-11-09 20:51:00 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.
Comment 1 Ralph Dolmans 2016-11-10 12:04:08 CET
Hi Aleks,

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!

-- Ralph
Comment 2 Wouter Wijngaards 2016-11-21 14:52:48 CET
Fix committed, closing issue.