Skip to content

Commit

Permalink
Handle unapplied phased updates in testinfra checks
Browse files Browse the repository at this point in the history
noble now has phased updates, in which the package repository will have
pending updates, but they won't be applied yet. We need to look for a
different message on noble to handle this change.

Fixes #7419.
  • Loading branch information
legoktm committed Jan 27, 2025
1 parent 416b3f9 commit afcd913
Showing 1 changed file with 10 additions and 4 deletions.
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
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

0 comments on commit afcd913

Please sign in to comment.