canonical / checkbox

Checkbox
https://checkbox.readthedocs.io
GNU General Public License v3.0
30 stars 44 forks source link

ipmi_test.py does not actualyl capture ipmitool output because it's only grabbing stdout #1273

Open bladernr opened 3 weeks ago

bladernr commented 3 weeks ago

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

  1. Install canonical-certification-server
  2. run sudo /usr/lib/checkbox-provider-base/bin/ipmi_test.py --debug > test.log
  3. Observe that test.log ONLY contains a couple lines of header output, but none of the actual debug output
  4. re-run like this: sudo /usr/lib/checkbox-provider-base/bin/ipmi_test.py --debug &> test.log
  5. observe that test.log now has the full debug output for later introspection

Environment

24.04 Server Checkbox 3.3.0.dev19

Relevant log output

No response

Additional context

No response

syncronize-issues-to-jira[bot] commented 3 weeks ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CHECKBOX-1460.

This message was autogenerated