Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Generalize RHEL 8 special cases #19533

Merged
merged 1 commit into from
Oct 27, 2023
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
4 changes: 2 additions & 2 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ You can set these environment variables to configure the test suite:
"fedora-39"
"fedora-coreos"
"fedora-testing"
"rhel-8-9"
"rhel-8-9-distropkg"
"rhel-8-10"
"rhel-8-10-distropkg"
"rhel-9-3"
"rhel4edge",
"ubuntu-2204"
Expand Down
2 changes: 1 addition & 1 deletion test/verify/check-connection
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ class TestConnection(testlib.MachineCase):

def checkMotdContent(string, expected=True):
# Needs https://github.com/linux-pam/linux-pam/pull/292 (or PAM 1.5.0)
old_pam = (m.image in ['centos-8-stream', 'ubuntu-2204', 'rhel-8-7', 'rhel-8-8', 'rhel-8-9'])
old_pam = m.image.startswith('rhel-8-') or m.image in ['centos-8-stream', 'ubuntu-2204']

# check issue (should be exactly the same as motd)
assertInOrNot(string, m.execute("cat /etc/issue.d/cockpit.issue"), expected)
Expand Down
6 changes: 3 additions & 3 deletions test/verify/check-metrics
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ class TestHistoryMetrics(testlib.MachineCase):
# Journal was recorded on Fedora 33 and when trying to use it with older systemd it fails with:
# `Journal file /var/log/journal/*/journal.journal uses an unsupported feature, ignoring file.`

if self.machine.image in ["centos-8-stream", "rhel-8-7", "rhel-8-8", "rhel-8-9"]:
if self.machine.image == "centos-8-stream" or self.machine.image.startswith("rhel-8-"):
return

m.upload(["verify/files/metrics-archives/journal.journal.gz"], "/tmp")
Expand Down Expand Up @@ -988,7 +988,7 @@ class TestCurrentMetrics(testlib.MachineCase):

# Test link to user services
# older releases don't have CPU accounting enabled for user services
if m.image not in ["rhel-8-7", "rhel-8-8", "rhel-8-9", "centos-8-stream"]:
if self.machine.image != "centos-8-stream" and not self.machine.image.startswith("rhel-8-"):
m.execute("su - admin -c 'XDG_RUNTIME_DIR=/run/user/$(id -u admin) systemd-run --user --collect --slice cockpittest -p CPUQuota=60% --unit cpu-userhog dd if=/dev/urandom of=/dev/null'")
# user services are always running underneath user@1000.service, so these two will compete for row 1 or 2
b.wait_in_text("table[aria-label='Top 5 CPU services'] tbody", "cpu-userhog")
Expand Down Expand Up @@ -1105,7 +1105,7 @@ BEGIN {{

# Test link to user services
# older releases don't have memory accounting enabled for user services
if m.image not in ["rhel-8-7", "rhel-8-8", "rhel-8-9", "centos-8-stream"]:
if m.image != "centos-8-stream" and not m.image.startswith("rhel-8"):
m.execute("su - admin -c 'XDG_RUNTIME_DIR=/run/user/$(id -u admin) systemd-run --user --collect --slice cockpittest --unit mem-userhog memhog.sh'")
m.execute("while [ ! -e /tmp/hogged ]; do sleep 1; done")
# user services are always running underneath user@1000.service, so these two will compete for row 1 or 2
Expand Down
6 changes: 3 additions & 3 deletions test/verify/check-system-info
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,12 @@ machine : 8561

b.reload()
b.enter_page('/system/hwinfo')
distros_without_systemd_memory_dmi = ['rhel-8-7', 'rhel-8-8', 'rhel-8-9', 'centos-8-stream']
distro_without_systemd_memory_dmi = m.image == 'centos-8-stream' or m.image.startswith('rhel-8-')

# Test more specific memory data with a fake dmidecode
b.wait_in_text('#memory-listing tbody:nth-of-type(1) td[data-label=ID]', "BANK 0: ChannelA-DIMM0")
b.wait_in_text('#memory-listing tbody:nth-of-type(1) td[data-label=Type]', "DDR4")
if m.image in distros_without_systemd_memory_dmi:
if distro_without_systemd_memory_dmi:
b.wait_in_text('#memory-listing tbody:nth-of-type(1) td[data-label=Size]', "4 GB")
else:
b.wait_in_text('#memory-listing tbody:nth-of-type(1) td[data-label=Size]', "4 GiB")
Expand All @@ -701,7 +701,7 @@ machine : 8561

b.wait_in_text('#memory-listing tbody:nth-of-type(2) td[data-label=ID]', "BANK 2: ChannelB-DIMM0")
b.wait_in_text('#memory-listing tbody:nth-of-type(2) td[data-label=Type]', "DDR4")
if m.image in distros_without_systemd_memory_dmi:
if distro_without_systemd_memory_dmi:
b.wait_in_text('#memory-listing tbody:nth-of-type(1) td[data-label=Size]', "4 GB")
else:
b.wait_in_text('#memory-listing tbody:nth-of-type(1) td[data-label=Size]', "4 GiB")
Expand Down
2 changes: 1 addition & 1 deletion test/verify/check-system-services
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ ExecStart=/bin/awk -f /tmp/mem-hog{params}.awk
self.goto_service("mem-hog.service")
b.wait_not_present("#memory")
# In some distros systemctl is showing memory current as [Not Set] for user units
if not user or m.image not in ["rhel-8-7", "rhel-8-8", "rhel-8-9", "centos-8-stream"]:
if not user or (m.image != "centos-8-stream" and not m.image.startswith("rhel-8-")):
self.run_systemctl(user, "start mem-hog.service")
# If the test fails before we stop mem-hog, the next test run will not get the correct memory usage here
self.addCleanup(self.run_systemctl, user, "stop mem-hog.service || true")
Expand Down