Skip to content

Commit

Permalink
fixed testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Feb 21, 2020
1 parent 9ddc6f2 commit 1a7cafb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/security_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def enabled?
context "writing to sysctl.conf" do
before do
allow(SCR).to exec_bash(/echo .* \/kernel\/sysrq/)
allow(sysctl_config).to receive(:conflict?).and_return(false)
end

it "does not write invalid values" do
Expand All @@ -205,13 +206,12 @@ def enabled?

it "does not write unchanged values" do
Security.Settings["net.ipv4.ip_forward"] = false
expect(sysctl_config).to_not receive(:raw_forward_ipv4=).with("0")
expect(sysctl_config).to_not receive(:save)
Security.write_kernel_settings
end

it "writes changed values" do
Security.Settings["net.ipv4.ip_forward"] = true
expect(sysctl_config).to receive(:raw_forward_ipv4=).with("1")
expect(sysctl_config).to receive(:save)
Security.write_kernel_settings
end
Expand Down

0 comments on commit 1a7cafb

Please sign in to comment.