Skip to content

Commit

Permalink
A better test for bnc#900352.
Browse files Browse the repository at this point in the history
test that the config files get written.
it correctly fails if the fix is removed :)
  • Loading branch information
mvidner committed Oct 10, 2014
1 parent 81ed39b commit 87305a9
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions test/routing_test.rb
Expand Up @@ -276,15 +276,24 @@ def fw_independent_write_expects
it "Checking routes entries" do
# Devices which have already been imported by Lan.Import have to be read.
# (bnc#900352)
expect(NetworkInterfaces)
allow(NetworkInterfaces)
.to receive(:List)
.with("") { ["eth0"] }
.with("")
.and_return(["eth0"])

Routing.Import(ay_test[:input])

exported = Routing.Export
expect(exported["routes"])
.to be_equal(ay_test["routes"]) if ay_test.has_key?("routes")
expect(Routing).
to receive(:write_route_file).
with("eth0", ay_test[:input].fetch("routes", [])).
and_return true

expect(Routing).
to receive(:write_route_file).
with("-", kind_of(Array)).
and_return true

Routing.Write
end

end
Expand Down

0 comments on commit 87305a9

Please sign in to comment.