Previously, the kernel parameter crashkernel will be set up when
kexec-tools is installed. But now it will happen only when kdump.service
is enabled first. When kexec-tools is freshly installed, the kdump.service
will be enabled according to the systemd policy file and later the
kernel parameter crashkernel will be added only if kdump.service is
enabled. Fedora disables kdump.service in the systemd policy. So enable
kdump.service in the systemd preset policy manually in the test script.
In case kexec-tools has already been installed, simply enable
kdump.service.
Fixes: 0ffce0ef ("Only try to reset crashkernel when kdump.service is enabled")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
tests/scripts/build-scripts/test-base-image.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/scripts/build-scripts/test-base-image.sh b/tests/scripts/build-scripts/test-base-image.sh
index afe1a974..3797a25a 100755
--- a/tests/scripts/build-scripts/test-base-image.sh
+++ b/tests/scripts/build-scripts/test-base-image.sh
@@ -16,6 +16,11 @@ img_inst $TESTDIR/scripts/kexec-kdump-test/test.sh /kexec-kdump-test/test.sh
img_inst $TESTDIR/scripts/kexec-kdump-test/kexec-kdump-test.service /etc/systemd/system/kexec-kdump-test.service
img_run_cmd "systemctl enable kexec-kdump-test.service"
+# enable kdump.service in the systemd preset policy so the kernel parameter crashkernel
+# will be added automatically when kexec-tools is freshly installed
+img_run_cmd "echo 'enable kdump.service' > /usr/lib/systemd/system-preset/95-kdump.preset"
+# In case kexec-tools has already been installed, simply enable kdump.serivce
+img_run_cmd " rpm --quiet -q kexec-tools && systemctl enable kdump.service"
img_inst_pkg $TEST_RPMS
# Test script should start kdump manually to save time
img_run_cmd "systemctl disable kdump.service"
--
2.44.0