Skip to content

Commit

Permalink
Test KDUMP_AUTO_RESIZE=no during autoinstallation and autoupgrade
Browse files Browse the repository at this point in the history
If auto resize is off, the kernel command line should contain the
default values, not the maximum values.
  • Loading branch information
ptesarik committed Feb 4, 2022
1 parent 8b78a68 commit 52476a0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/kdump_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@

context "during autoinstallation" do
let(:bootlader_kernel_params) { ["2047M,high"] }
let(:bootloader_kernel_params_noauto) { ["73M,high"] }
let(:bootlader_xen_kernel_params) { ["73M\\<4G"] }

before do
Expand Down Expand Up @@ -496,6 +497,23 @@
end
end

context "if kdump is requested, no value for crashkernel is supplied, and auto-resize is disabled" do
let(:profile) { { "add_crash_kernel" => true, "general" => { "KDUMP_AUTO_RESIZE" => "no" } } }

it "writes a proposed crashkernel in the bootloader and enables the service" do
expect(Yast::Bootloader)
.to receive(:modify_kernel_params)
.with(:common, :recovery, "crashkernel" => bootloader_kernel_params_noauto)
expect(Yast::Bootloader)
.to receive(:modify_kernel_params)
.with(:xen_host, "crashkernel" => bootlader_xen_kernel_params)
expect(Yast::Bootloader).to receive(:Write)
expect(Yast::Service).to receive(:Enable).with("kdump")

Yast::Kdump.WriteKdumpBootParameter
end
end

context "if kdump is explicitly disabled" do
let(:profile) { { "add_crash_kernel" => false, "crash_kernel" => "does_not_matter" } }

Expand Down Expand Up @@ -530,6 +548,7 @@

context "during autoupgrade" do
let(:bootlader_kernel_params) { ["1968M,high"] }
let(:bootloader_kernel_params_noauto) { ["75M,high"] }
let(:bootlader_xen_kernel_params) { ["75M\\<4G"] }

before do
Expand Down Expand Up @@ -592,6 +611,23 @@
end
end

context "if kdump is requested, no value for crashkernel is supplied, and auto-resize is disabled" do
let(:profile) { { "add_crash_kernel" => true, "general" => { "KDUMP_AUTO_RESIZE" => "no" } } }

it "rewrites the bootloader crashkernel settings and enables the service" do
expect(Yast::Bootloader)
.to receive(:modify_kernel_params)
.with(:common, :recovery, "crashkernel" => bootloader_kernel_params_noauto)
expect(Yast::Bootloader)
.to receive(:modify_kernel_params)
.with(:xen_host, "crashkernel" => bootlader_xen_kernel_params)
expect(Yast::Bootloader).to receive(:Write)
expect(Yast::Service).to receive(:Enable).with("kdump")

Yast::Kdump.WriteKdumpBootParameter
end
end

context "if kdump is explicitly disabled" do
let(:profile) { { "add_crash_kernel" => false, "crash_kernel" => "does_not_matter" } }

Expand Down

0 comments on commit 52476a0

Please sign in to comment.