When ipmi_test.py runs in debug mode it only captures the stdout messages though the wealth of debug messaging is dumped to console and then lost. This is because the script is only capturing and outputting stdout. The command output when run is actually being dumped to stderr instead.
To resolve this, the script should be capturing both stdout and stderr to ensure they are both output to stdout so that they can be saved to a log file by a user the first time without having to re-run using redirects to capture everything.
To Reproduce
Install canonical-certification-server
run sudo /usr/lib/checkbox-provider-base/bin/ipmi_test.py --debug > test.log
Observe that test.log ONLY contains a couple lines of header output, but none of the actual debug output
re-run like this: sudo /usr/lib/checkbox-provider-base/bin/ipmi_test.py --debug &> test.log
observe that test.log now has the full debug output for later introspection
Bug Description
When ipmi_test.py runs in debug mode it only captures the stdout messages though the wealth of debug messaging is dumped to console and then lost. This is because the script is only capturing and outputting stdout. The command output when run is actually being dumped to stderr instead.
To resolve this, the script should be capturing both stdout and stderr to ensure they are both output to stdout so that they can be saved to a log file by a user the first time without having to re-run using redirects to capture everything.
To Reproduce
sudo /usr/lib/checkbox-provider-base/bin/ipmi_test.py --debug > test.log
sudo /usr/lib/checkbox-provider-base/bin/ipmi_test.py --debug &> test.log
Environment
24.04 Server Checkbox 3.3.0.dev19
Relevant log output
No response
Additional context
No response