Skip to content

Commit

Permalink
Fix update of hardware information.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Aug 29, 2019
1 parent 4c31f20 commit 2dcadd8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/lib/y2network/interface_config_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,13 @@ def mtu=(value)
@connection_config.mtu = value.to_i
end

# @param info [Hash<String,Object>] Hardware information
# @return [Hwinfo]
def hwinfo_from(info)
@hwinfo = Hwinfo.new(info)
end

# @return [Hwinfo]
def hwinfo
@hwinfo ||= Hwinfo.for(name)
end
Expand Down
4 changes: 2 additions & 2 deletions test/y2network/s390_device_activators/ctc_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
context "given the read or write device id" do
let(:device_id) { "0.0.0800:0.0.0801" }
let(:write_channel) { "0.0.0801" }
let(:hwinfo) { Y2Network::Hwinfo.new(hwinfo: { "busid" => write_channel }) }
let(:hwinfo) { Y2Network::Hwinfo.new("busid" => write_channel) }
before do
allow(builder).to receive(:hwinfo).and_return(hwinfo)
allow(executor).to receive(:on_target!)
Expand All @@ -107,7 +107,7 @@
let(:initialize_channels) { false }
let(:device_id) { "0.0.0800:0.0.0801" }
let(:write_channel) { "0.0.0801" }
let(:hwinfo) { Y2Network::Hwinfo.new(hwinfo: { "busid" => write_channel }) }
let(:hwinfo) { Y2Network::Hwinfo.new("busid" => write_channel) }

before do
allow(subject).to receive(:device_id_from).with(write_channel).and_return(device_id)
Expand Down
4 changes: 2 additions & 2 deletions test/y2network/s390_device_activators/qeth_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
context "given the read or write device id" do
let(:device_id) { "0.0.0800:0.0.0801:0.0.0802" }
let(:write_channel) { "0.0.0801" }
let(:hwinfo) { Y2Network::Hwinfo.new(hwinfo: { "busid" => write_channel }) }
let(:hwinfo) { Y2Network::Hwinfo.new("busid" => write_channel) }
before do
allow(builder).to receive(:hwinfo).and_return(hwinfo)
allow(executor).to receive(:on_target!)
Expand All @@ -108,7 +108,7 @@
let(:initialize_channels) { false }
let(:device_id) { "0.0.0800:0.0.0801:0.0.0802" }
let(:write_channel) { "0.0.0801" }
let(:hwinfo) { Y2Network::Hwinfo.new(hwinfo: { "busid" => write_channel }) }
let(:hwinfo) { Y2Network::Hwinfo.new("busid" => write_channel) }

before do
allow(subject).to receive(:device_id_from).with(write_channel).and_return(device_id)
Expand Down

0 comments on commit 2dcadd8

Please sign in to comment.