Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Robustify scheduled reboot check in TestAutoUpdates.testWithAva…
…ilableUpdates This test often fails because the "Reboot scheduled" message does not reliably appear in dnf-automatic-install.service's journal. The scheduled reboot still works, though. Robustify this by replacing the journal scraping with a direct check for a scheduled reboot. Newer systemd versions offer `shutdown --show` for this, which exits with 1 and prints "No scheduled shutdown", or exits with 0 and prints "Reboot scheduled for <date>...". On RHEL8 we already have the `/run/nologin` check, which tests this enough. (Also, RHEL 8 support will drop in less than a month, so not important any more). Drop the obsolete "Shutdown" absence check from the case where no shutdown should be scheduled. Recent systemd says "Reboot" (so this was a no-op), and checking for an absent /run/nologin is sufficient. To avoid destroying the testbed, ensure that the test always cancels the scheduled shutdown even if the check fails. Fixes #19812
- Loading branch information