Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tmt/tests/booted/test-image-pushpull-upgrade.nu
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ RUN echo test content > /usr/share/blah.txt
let rr_meta = (ls /run/reboot-required | first)
assert equal $rr_meta.size 0b

# Also test that the mtime changes on modification
# Verify that we logged to the journal
journalctl _MESSAGE_ID=3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The message ID being checked appears to be incorrect for this test case. The bootc switch command executed on line 63 does not include the --mutate-in-place flag, so it performs a standard switch operation. The journal message for a standard switch has the ID 7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1, not 3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b7 which is for an in-place switch.

Additionally, the check is implicit, relying on the exit code of journalctl. It would be more robust and explicit to check that at least one log entry is found, for example by explicitly checking the exit code of the command.

let result = do --ignore-errors { journalctl --quiet _MESSAGE_ID=7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1 }
assert $result.exit_code == 0

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, well spotted gemini except...actually the problem is switch in place and switch have the same message ID, which was probably (?) not intentional.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so do we change the ID then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we should change one of them, but I would say it should be a separate PR?


# The mtime should change on modification
let new_root_mtime = ls -Dl /ostree/bootc | get modified
assert ($new_root_mtime > $orig_root_mtime)

Expand Down