SUSE-Enceladus / img-proof

img-proof provides a command line utility to test images in the Public Cloud
https://img-proof.readthedocs.io/en/latest/
GNU General Public License v3.0
14 stars 7 forks source link

Show command stdout/err when setup_swap() fails #371

Closed ricardobranco777 closed 7 months ago

ricardobranco777 commented 7 months ago

Show command output to help debugging issue with setup_swap()

Verification run: https://openqa.suse.de/tests/13310302/logfile?filename=serial_terminal.txt

We're having issue: STDERR: truncate: failed to truncate '/swap' at 0 bytes: Text file busy

m-dati commented 7 months ago

LGTM :smiley:

smarlowucf commented 7 months ago

As the PR is still changing I will wait until it stabilizes to review. Note: that img-proof and pytest redirect output so printing to file=sys.stderr might not work as expected. Will need to test this to be sure.

ricardobranco777 commented 7 months ago

As the PR is still changing I will wait until it stabilizes to review. Note: that img-proof and pytest redirect output so printing to file=sys.stderr might not work as expected. Will need to test this to be sure.

It works as expected as from our side we consume it in openQA.

The PR is mostly done but I'm investigating an issue with creating the swap file. Have you ever got this error Text file busy while writing to filesystem in public cloud?

smarlowucf commented 7 months ago

It works as expected as from our side we consume it in openQA.

From my testing it subverts the img-proof stdout redirect and dumps messages to terminal which means they don't end up in the log file. Doing a normal print to terminal allows img-proof to catch and handles these correctly.

smarlowucf commented 7 months ago

Thanks @ricardobranco777 LGTM 👍🏼

smarlowucf commented 7 months ago

Have you ever got this error Text file busy while writing to filesystem in public cloud?

Not that I can remember off the top of my head. It's possible though. Maybe the system wasn't fully booted yet?