inspec/test/unit/resources/bond_test.rb
Ryan Davis 07dc5e3192 First pass at cleaning deprecations for old minitest/spec-style tests.
3 files left to go, and they're behaving oddly so I'm leaving them out
in this pass. Looks like 21 deprecations left.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-03 13:45:19 -07:00

23 lines
769 B
Ruby

require "helper"
require "inspec/resource"
require "inspec/resources/bond"
describe "Inspec::Resources::Bond" do
it "check linux bond on ubuntu" do
resource = MockLoader.new(:ubuntu1404).load_resource("bond", "bond0")
# bond must be available
_(resource.exist?).must_equal true
# get bonding mode
_(resource.mode).must_equal "IEEE 802.3ad Dynamic link aggregation"
# eth0 is part of bond
_(resource.has_interface?("eth0")).must_equal true
_(resource.has_interface?("eth1")).must_equal false
_(resource.has_interface?("eth2")).must_equal true
# get all interfaces
_(resource.interfaces).must_equal %w{eth0 eth2}
# get proc content
_(resource.content).wont_equal nil
_(resource.content).wont_equal ""
end
end