Skip to content

Commit

Permalink
Merge pull request #93 from yast/fix_control_disable
Browse files Browse the repository at this point in the history
Fix control disable
  • Loading branch information
jreidinger committed Dec 15, 2017
2 parents 9e7fee8 + 4f0eeb5 commit 0c35e85
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
7 changes: 7 additions & 0 deletions package/yast2-kdump.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Dec 15 11:34:57 UTC 2017 - jreidinger@suse.com

- Show kdump as disabled in an installation proposal if the product
disables it (bsc#1071242)
- 4.0.0

-------------------------------------------------------------------
Thu Aug 10 09:06:45 UTC 2017 - ancor@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-kdump.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-kdump
Version: 3.3.2
Version: 4.0.0
Release: 0
Summary: Configuration of kdump
License: GPL-2.0
Expand Down
17 changes: 5 additions & 12 deletions src/modules/Kdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -621,17 +621,6 @@ def Write

#number of stages
steps = 2
if Mode.installation
write_kdump = ProductFeatures.GetBooleanFeature(
"globals",
"enable_kdump"
)
if write_kdump == nil || !write_kdump
Builtins.y2milestone("Installation doesn't support kdump.")
return true
end
end

if (Mode.installation || Mode.autoinst) && !@add_crashkernel_param
Builtins.y2milestone(
"Skip writing of configuration for kdump during installation"
Expand Down Expand Up @@ -700,8 +689,12 @@ def AddPackages
# @return [Boolean] the default proposed state

def ProposeCrashkernelParam
# proposing disabled kdump if product wants it (bsc#1071242)
if !ProductFeatures.GetBooleanFeature("globals", "enable_kdump")
log.info "Kdump disabled in control file"
false
# proposing disabled kdump if PC has less than 1024MB RAM
if total_memory < 1024
elsif total_memory < 1024
log.info "not enough memory - kdump proposed as disabled"
false
# proposing disabled kdump on aarch64 (bsc#989321) - kdump not implemented
Expand Down
11 changes: 11 additions & 0 deletions test/kdump_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
before do
allow(Yast::Kdump).to receive(:total_memory).and_return 1024
allow(Yast::Arch).to receive(:aarch64).and_return false
allow(Yast::ProductFeatures).to receive(:GetBooleanFeature).with("globals", "enable_kdump")
.and_return(true)
end

context "while running on machine with less than 1024 MB memory" do
Expand All @@ -68,6 +70,15 @@
end
end

context "while product disabled kdump" do
it "proposes kdump to be disabled" do
allow(Yast::ProductFeatures).to receive(:GetBooleanFeature).with("globals", "enable_kdump")
.and_return(false)

expect(Yast::Kdump.ProposeCrashkernelParam).to eq false
end
end

context "otherwise" do
it "always proposes kdump to be enabled" do
expect(Yast::Kdump.ProposeCrashkernelParam).to eq true
Expand Down

0 comments on commit 0c35e85

Please sign in to comment.