Skip to content

Commit

Permalink
Merge pull request #354 from kobliha/make_iscsi_proposal_public
Browse files Browse the repository at this point in the history
Make iscsi_proposal public
  • Loading branch information
kobliha committed May 18, 2015
2 parents 2517c5f + ea85192 commit 97568ee
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
5 changes: 3 additions & 2 deletions library/network/src/modules/SuSEFirewallProposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,6 @@ def ProposalSummary
{ "output" => output, "warning" => warning }
end

private

# Proposes firewall settings for iSCSI
def propose_iscsi
log.info "iSCSI has been used during installation, opening #{@iscsi_target_service} service"
Expand All @@ -781,6 +779,8 @@ def propose_iscsi

# bsc#916376: ports need to be open already during boot
SuSEFirewall.full_init_on_boot(true)

nil
end

publish function: :OpenServiceOnNonDialUpInterfaces, type: "void (string, list <string>)"
Expand All @@ -791,6 +791,7 @@ def propose_iscsi
publish function: :Reset, type: "void ()"
publish function: :Propose, type: "void ()"
publish function: :ProposalSummary, type: "map <string, string> ()"
publish function: :propose_iscsi, type: "void ()"
end

SuSEFirewallProposal = SuSEFirewallProposalClass.new
Expand Down
32 changes: 24 additions & 8 deletions library/network/test/susefirewall_proposal_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,38 @@

describe Yast::SuSEFirewallProposal do
describe "#ProposeFunctions" do
context "when iscsi is used" do
it "calls the iscsi proposal" do
allow(Yast::Linuxrc).to receive(:useiscsi).and_return(true)
expect(Yast::SuSEFirewallProposal).to receive(:propose_iscsi).and_return(nil)

Yast::SuSEFirewallProposal.ProposeFunctions
end
end

context "when iscsi is not used" do
it "does not call the iscsi proposal" do
allow(Yast::Linuxrc).to receive(:useiscsi).and_return(false)
expect(Yast::SuSEFirewallProposal).not_to receive(:propose_iscsi)

Yast::SuSEFirewallProposal.ProposeFunctions
end
end
end

describe "#propose_iscsi" do
before(:each) do
allow(Yast::SuSEFirewall).to receive(:GetAllNonDialUpInterfaces).and_return(["eth44", "eth55"])
allow(Yast::SuSEFirewall).to receive(:GetZonesOfInterfaces).and_return(["EXT"])
allow(Yast::SuSEFirewallServices).to receive(:IsKnownService).and_return(true)
allow(Yast::SuSEFirewallProposal).to receive(:ServiceEnabled).and_return(true)
end

context "when iscsi is used" do
it "proposes opening iscsi-target firewall service and full firewall initialization on boot" do
allow(Yast::Linuxrc).to receive(:useiscsi).and_return("initial")

expect(Yast::SuSEFirewall).to receive(:full_init_on_boot).and_return(true)
expect(Yast::SuSEFirewall).to receive(:SetServicesForZones).with(["service:iscsitarget"], ["EXT"], true).and_return(true)
it "proposes opening iscsi-target firewall service and full firewall initialization on boot" do
expect(Yast::SuSEFirewall).to receive(:full_init_on_boot).and_return(true)
expect(Yast::SuSEFirewall).to receive(:SetServicesForZones).with(["service:iscsitarget"], ["EXT"], true).and_return(true)

Yast::SuSEFirewallProposal.ProposeFunctions
end
Yast::SuSEFirewallProposal.propose_iscsi
end
end
end
7 changes: 7 additions & 0 deletions package/yast2.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon May 18 10:32:24 CEST 2015 - locilka@suse.com

- Making SuSEFirewallProposal.propose_iscsi function public
(bsc#916376)
- 3.1.108.4

-------------------------------------------------------------------
Wed May 13 15:03:50 CEST 2015 - locilka@suse.com

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


Name: yast2
Version: 3.1.108.3
Version: 3.1.108.4
Release: 0
URL: https://github.com/yast/yast-yast2

Expand Down

0 comments on commit 97568ee

Please sign in to comment.