From dbda05567e8f02df62530c12d773e81d3db7a272 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Mon, 28 Oct 2024 14:01:27 -0400 Subject: [PATCH] Expand some testinfra checks to expect noble --- molecule/testinfra/common/test_automatic_updates.py | 6 ++++-- molecule/testinfra/common/test_platform.py | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/molecule/testinfra/common/test_automatic_updates.py b/molecule/testinfra/common/test_automatic_updates.py index 74bd99ab54..07d347ac7a 100644 --- a/molecule/testinfra/common/test_automatic_updates.py +++ b/molecule/testinfra/common/test_automatic_updates.py @@ -119,9 +119,11 @@ def test_unattended_upgrades_functional(host): """ c = host.run("sudo unattended-upgrades --dry-run --debug") assert c.rc == 0 + distro = host.system_info.codename expected_origins = ( - "Allowed origins are: origin=Ubuntu,archive=focal, origin=Ubuntu,archive=focal-security" - ", origin=Ubuntu,archive=focal-updates, origin=SecureDrop,codename=focal" + f"Allowed origins are:" + 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" diff --git a/molecule/testinfra/common/test_platform.py b/molecule/testinfra/common/test_platform.py index e751a4bf96..ab42853db3 100644 --- a/molecule/testinfra/common/test_platform.py +++ b/molecule/testinfra/common/test_platform.py @@ -15,9 +15,9 @@ def test_ansible_version(host): def test_platform(host): """ - SecureDrop requires Ubuntu 20.04 LTS + SecureDrop requires Ubuntu 20.04 (focal) or 24.04 (noble) """ assert host.system_info.type == "linux" assert host.system_info.distribution == "ubuntu" - assert host.system_info.codename == "focal" - assert host.system_info.release == "20.04" + version = (host.system_info.codename, host.system_info.release) + assert version in {("focal", "20.04"), ("noble", "24.04")}