Skip to content

Commit

Permalink
test: Drop remaining vestiges of yum
Browse files Browse the repository at this point in the history
That was a RHEL 7 thing, and dead code.
  • Loading branch information
martinpitt committed Dec 6, 2023
1 parent 36b63a7 commit 05fc2d8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
4 changes: 2 additions & 2 deletions test/common/packagelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def setUp(self):
else:
self.restore_dir("/etc/yum.repos.d", reboot_safe=True)
self.restore_dir("/var/cache/dnf", reboot_safe=True)
self.machine.execute("rm -rf /etc/yum.repos.d/* /var/cache/yum/* /var/cache/dnf/*")
self.machine.execute("rm -rf /etc/yum.repos.d/* /var/cache/dnf/*")

# have PackageKit start from a clean slate
self.machine.execute("systemctl stop packagekit")
Expand Down Expand Up @@ -425,4 +425,4 @@ def enableRepo(self):
echo '{1}' > /tmp/updateinfo.xml
createrepo_c {0}
modifyrepo_c /tmp/updateinfo.xml {0}/repodata
$(which dnf 2>/dev/null|| which yum) clean all""".format(self.repo_dir, self.createYumUpdateInfo()))
dnf clean all""".format(self.repo_dir, self.createYumUpdateInfo()))
23 changes: 3 additions & 20 deletions test/verify/check-packagekit
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NoSubManCase(packagelib.PackageCase):
super().setUp()

# Disable Subscription Manager on RHEL for these tests; subscriptions are tested in a separate class
# On other OSes (Fedora/CentOS) we expect sub-man to be disabled in yum, so it should not get in the way there
# On other OSes (Fedora/CentOS) we expect sub-man to be disabled in dnf, so it should not get in the way there
if self.machine.image.startswith("rhel") or self.machine.image.startswith("centos"):
self.machine.execute("systemctl stop rhsm.service; systemctl mask rhsm.service")
self.addCleanup(self.machine.execute, "systemctl unmask rhsm.service")
Expand All @@ -52,7 +52,7 @@ class TestUpdates(NoSubManCase):

pkcon_version = self.machine.execute("pkcon --version").strip()

# only the yum and PackageKit ≥ 1.2.4 dnf (https://github.com/PackageKit/PackageKit/issues/268) backends
# only the PackageKit ≥ 1.2.4 dnf (https://github.com/PackageKit/PackageKit/issues/268) backends
# properly recognize "enhancement" severity; apt does not have that metadata
self.supports_severity = not (self.backend == "apt" or pkcon_version < "1.2.4")

Expand Down Expand Up @@ -720,23 +720,6 @@ ExecStart=/usr/local/bin/{packageName}
sel = self.check_nth_update(3, "sevcritical", "5-2", "security", 1,
desc_matches=["More broken stuff"])

if self.backend == 'yum':
# sevcritical has a severity and errata
details = b.text(sel + " .pf-m-expanded")
self.assertIn("Severity", details)
self.assertIn("critical", details)
self.assertIn("Errata", details)
self.assertIn("RHSA-2000:0001", details)
self.assertIn("RHSA-2000:0002", details)
# icon has critical class
self.assertIn("severity-critical", b.attr(sel + " .severity-icon", "class"))
b.mouse(sel + " .severity-icon", "mouseenter")
b.wait_text(".pf-v5-c-tooltip", "critical")
b.mouse(sel + " .severity-icon", "mouseleave")
b.wait_not_present(".pf-v5-c-tooltip")
# details has link to severity definition
self.assertIn("access.redhat.com", b.attr(sel + " .pf-m-expanded dd.severity a:first-of-type", "href"))

# buggy: bug refs, no security
sel = self.check_nth_update(4, "buggy", "2-2", "bug", 2, bugs=["123", "456"], desc_matches=["Fixit"])
# should filter out enumeration in overview
Expand Down Expand Up @@ -1412,7 +1395,7 @@ class TestAutoUpdates(NoSubManCase):

def setUp(self):
super().setUp()
# not implemented for yum and apt yet, only dnf
# not implemented for apt yet, only dnf
self.supported_backend = self.backend in ["dnf"]
if self.backend == 'dnf':
self.restore_file("/etc/dnf/automatic.conf")
Expand Down
2 changes: 1 addition & 1 deletion test/verify/check-system-realms
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ class TestPackageInstall(packagelib.PackageCase):
m = self.machine
b = self.browser

m.execute("dpkg --purge realmd 2>/dev/null || rpm --erase realmd || yum remove -y realmd")
m.execute("dpkg --purge realmd 2>/dev/null || rpm --erase realmd || dnf remove -y realmd")

# case 1: disable PackageKit
m.execute("systemctl mask packagekit; systemctl stop packagekit.service || true")
Expand Down

0 comments on commit 05fc2d8

Please sign in to comment.