Skip to content

Commit

Permalink
Added unit test to verify wrong alloc_mem parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilson Souza committed Jun 21, 2017
1 parent b936250 commit 86531c1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/client_test.rb
@@ -1,12 +1,21 @@
require_relative "./test_helper"
require_relative "../src/clients/kdump"
Yast.import "CommandLine"

describe Yast::KdumpClient do

describe ".cmdKdumpStartup" do
let(:alloc_mem_high) {"100"}
let(:alloc_mem_low) {"50"}


context "When using wrong inputs in alloc memory" do
let(:options) {{"enable"=>"", "alloc_mem"=>"#{alloc_mem_low}:#{alloc_mem_high}"}}

it "does not enable kdump and return false" do
expect(subject.cmdKdumpStartup(options)).to be false
end
end

context "When using alloc memory high and low" do
let(:options) {{"enable"=>"", "alloc_mem"=>"#{alloc_mem_low},#{alloc_mem_high}"}}

Expand All @@ -17,7 +26,7 @@
expect(Yast::Kdump.add_crashkernel_param).to be true
end
end

context "when using only alloc memory low" do
let(:options) {{"enable"=>"", "alloc_mem"=>"#{alloc_mem_low}"}}

Expand Down

0 comments on commit 86531c1

Please sign in to comment.