diff --git a/tests/integration_tests/modules/test_apt_functionality.py b/tests/integration_tests/modules/test_apt_functionality.py index a2b7172e145..e4f7e708b1a 100644 --- a/tests/integration_tests/modules/test_apt_functionality.py +++ b/tests/integration_tests/modules/test_apt_functionality.py @@ -18,6 +18,7 @@ CURRENT_RELEASE, IS_UBUNTU, MANTIC, + QUESTING, ) from tests.integration_tests.util import ( get_feature_flag_value, @@ -523,11 +524,16 @@ def test_apt_proxy(client: IntegrationInstance): r"software-properties-common', 'gnupg)" ) -REMOVE_GPG_USERDATA = """ +GPG_PACKAGES = "gpg software-properties-common" +# On Ubuntu Resolute and newer, gpg-from-sq can replace the gpg metapackage +# when gpg is removed. Remove other packages which rdepend on gpg to avoid +# gpg-from-sq being installed as an alternative to gpg. +GPG_PACKAGES_SQ = f"{GPG_PACKAGES} python3-software-properties libgpgme45" + +REMOVE_GPG_USERDATA_TMPL = """ #cloud-config runcmd: - - DEBIAN_FRONTEND=noninteractive apt-get remove gpg -y - - DEBIAN_FRONTEND=noninteractive apt-get remove software-properties-common -y + - DEBIAN_FRONTEND=noninteractive apt-get remove {packages} -y """ @@ -570,9 +576,11 @@ def test_install_missing_deps(session_cloud: IntegrationCloud): 'software-properties-common' are installed successfully. """ # Two stage install: First stage: remove gpg noninteractively from image - instance1 = session_cloud.launch( - user_data=_do_oci_customization(REMOVE_GPG_USERDATA) - ) + if CURRENT_RELEASE <= QUESTING: + userdata = REMOVE_GPG_USERDATA_TMPL.format(packages=GPG_PACKAGES) + else: + userdata = REMOVE_GPG_USERDATA_TMPL.format(packages=GPG_PACKAGES_SQ) + instance1 = session_cloud.launch(user_data=_do_oci_customization(userdata)) # look for r"un gpg" using regex ('un' means uninstalled) for package in ["gpg", "software-properties-common"]: diff --git a/tests/unittests/config/test_cc_phone_home.py b/tests/unittests/config/test_cc_phone_home.py index 9c07d23b8dc..d44f365cff2 100644 --- a/tests/unittests/config/test_cc_phone_home.py +++ b/tests/unittests/config/test_cc_phone_home.py @@ -54,8 +54,8 @@ def test_no_url(self, m_readurl, caplog): (0, -1), (1, 0), (2, 1), - # override parametrized id to differentiate str "2" from int 2 in former test - # GH pytest-dev/pytest#14650. + # override parametrized id to differentiate str "2" from int 2 in + # former test GH pytest-dev/pytest#14650. pytest.param("2", 1, id="retries-as-int-str"), ("two", 9), (None, 9),