Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 14 additions & 6 deletions tests/integration_tests/modules/test_apt_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
CURRENT_RELEASE,
IS_UBUNTU,
MANTIC,
QUESTING,
)
from tests.integration_tests.util import (
get_feature_flag_value,
Expand Down Expand Up @@ -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
"""


Expand Down Expand Up @@ -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"]:
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/config/test_cc_phone_home.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading