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: Enable kdump on Fedora 39 #19524

Merged
merged 1 commit into from
Oct 26, 2023
Merged
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
39 changes: 13 additions & 26 deletions test/verify/check-kdump
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ class KdumpHelpers(testlib.MachineCase):
self.allow_restart_journal_messages()

def enableKdump(self):
# all current Fedora/CentOS/RHEL images use BootLoaderSpec
if self.machine.image == "fedora-38":
self.machine.execute("grubby --args=crashkernel=192M --update-kernel=ALL")
if self.machine.image.startswith("fedora"):
self.machine.execute("systemctl enable kdump; kdumpctl reset-crashkernel")
self.machine.reboot()

self.machine.start_cockpit()
self.browser.switch_to_top()
self.browser.relogin("/kdump")

def crashKernel(self, message, cancel=False):
b = self.browser
b.click(f"button{self.default_btn_class}")
Expand Down Expand Up @@ -72,20 +67,15 @@ class TestKdump(KdumpHelpers):
m = self.machine

b.wait_timeout(120)
if m.image.startswith("fedora"):
m.execute("systemctl enable --now kdump")
else:
m.execute("until systemctl is-active kdump; do sleep 1; done")

self.login_and_go("/kdump")

b.wait_visible("#app")

def assertActive(active):
b.wait_visible(".pf-v5-c-switch__input" + (active and ":checked" or ":not(:checked)"))

if m.image in ["fedora-38"]:
# crashkernel command line not set
if m.image.startswith("fedora"):
# crashkernel command line not set, needs to be explicitly enabled in Fedora
b.wait_visible(".pf-v5-c-switch__input:disabled")
# right now we have no memory reserved
b.mouse("span + div > .popover-ct-kdump", "mouseenter")
Expand All @@ -107,15 +97,19 @@ class TestKdump(KdumpHelpers):
b.mouse("button:contains(Test configuration)", "mouseenter")
b.wait_in_text(".pf-v5-c-tooltip", "kdump service")
b.mouse("button:contains(Test configuration)", "mouseleave")

# enable it
self.enableKdump()
self.login_and_go("/kdump")
else:
# most OSes have a default crashkernel=
# enabled by default in RHEL
m.execute("until systemctl is-active kdump; do sleep 1; done")
b.wait_in_text("#app", "Service is running")
assertActive(active=True)

# there shouldn't be any crash reports in the target directory
self.assertEqual(m.execute("find /var/crash -maxdepth 1 -mindepth 1 -type d"), "")

self.enableKdump()
b.wait_visible("#app")
self.enableLocalSsh()

Expand Down Expand Up @@ -157,7 +151,6 @@ class TestKdump(KdumpHelpers):
# we should have the amount of memory reserved that crashkernel=auto defaults to for our VM RAM size
b.wait_in_text("#app", "192 MiB")
# service should start up properly and the button should be on
b.wait_in_text("#app", "Service is running")
assertActive(active=True)
b.wait_in_text("#app", "Service is running")
b.wait_text("#kdump-change-target", "Remote over SSH")
Expand Down Expand Up @@ -427,8 +420,10 @@ class TestKdumpNFS(KdumpHelpers):
self.assertEqual(m.execute("find /var/crash -maxdepth 1 -mindepth 1 -type d"), "")

# set up client machine
self.login_and_go("/kdump")
self.enableKdump()
self.login_and_go("/kdump")
with b.wait_timeout(120): # needs to rebuild initrd
b.wait_in_text("#app", "Service is running")

# switch to NFS
b.click("#kdump-change-target")
Expand All @@ -441,14 +436,6 @@ class TestKdumpNFS(KdumpHelpers):
with b.wait_timeout(300):
b.wait_not_present("#kdump-settings-dialog")

# enable service, regenerates initrd and tests NFS settings
if m.image.startswith("fedora"):
b.wait_visible(".pf-v5-c-switch__input:not(:checked)")
b.click(".pf-v5-c-switch__input")
with b.wait_timeout(300):
b.wait_visible(".pf-v5-c-switch__input:checked")
b.wait_in_text("#app", "Service is running")

# explicit nfs option, unset path
conf = m.execute("cat /etc/kdump.conf")
self.assertIn("\nnfs 10.111.113.2:/srv/kdump\n", conf)
Expand Down