Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unapplied phased updates in testinfra checks #7420

Merged
merged 1 commit into from
Jan 28, 2025
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
14 changes: 10 additions & 4 deletions molecule/testinfra/common/test_automatic_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,18 @@ def test_unattended_upgrades_functional(host):
f" origin=Ubuntu,archive={distro}, origin=Ubuntu,archive={distro}-security"
f", origin=Ubuntu,archive={distro}-updates, origin=SecureDrop,codename={distro}"
)
expected_result = (
"No packages found that can be upgraded unattended and no pending auto-removals"
)

all_good = "No packages found that can be upgraded unattended and no pending auto-removals"
assert expected_origins in c.stdout
assert expected_result in c.stdout
if distro == "focal":
assert all_good in c.stdout
else: # noqa: PLR5501
cfm marked this conversation as resolved.
Show resolved Hide resolved
if all_good in c.stdout:
assert all_good in c.stdout
else:
# noble+ uses phased updates, so there may be packages that can be
# upgraded that won't be upgraded; look for a different message in that case
assert "left to upgrade set()\nAll upgrades installed" in c.stdout


@pytest.mark.parametrize(
Expand Down
Loading