2015-09-03 17:33:19 +02:00
|
|
|
# encoding: utf-8
|
2015-10-06 18:55:44 +02:00
|
|
|
# author: Christoph Hartmann
|
|
|
|
# author: Dominik Richter
|
2015-09-03 17:33:19 +02:00
|
|
|
|
|
|
|
require 'helper'
|
2015-10-26 04:04:18 +01:00
|
|
|
require 'inspec/resource'
|
2015-09-03 17:33:19 +02:00
|
|
|
|
2015-10-26 04:04:18 +01:00
|
|
|
describe 'Inspec::Resources::Bond' do
|
2015-09-03 17:33:19 +02:00
|
|
|
|
2015-10-12 13:21:50 +02:00
|
|
|
it 'check linux bond on ubuntu' do
|
|
|
|
resource = MockLoader.new(:ubuntu1404).load_resource('bond', 'bond0')
|
|
|
|
# bond must be available
|
2015-09-22 18:33:05 +02:00
|
|
|
resource.exist?.must_equal true
|
2015-10-12 13:21:50 +02:00
|
|
|
# eth0 is part of bond
|
2015-09-22 18:33:05 +02:00
|
|
|
_(resource.has_interface?('eth0')).must_equal true
|
|
|
|
_(resource.has_interface?('eth1')).must_equal false
|
|
|
|
_(resource.has_interface?('eth2')).must_equal true
|
2015-10-12 13:21:50 +02:00
|
|
|
# get all interfaces
|
2015-09-22 18:33:05 +02:00
|
|
|
_(resource.interfaces).must_equal %w{eth0 eth2}
|
2015-10-12 13:21:50 +02:00
|
|
|
# get proc content
|
2015-09-22 18:33:05 +02:00
|
|
|
_(resource.content).wont_equal nil
|
|
|
|
_(resource.content).wont_equal ''
|
2015-09-03 17:33:19 +02:00
|
|
|
end
|
|
|
|
end
|