2015-09-03 15:33:19 +00:00
|
|
|
# encoding: utf-8
|
2015-10-06 16:55:44 +00:00
|
|
|
# author: Christoph Hartmann
|
|
|
|
# author: Dominik Richter
|
2015-09-03 15:33:19 +00:00
|
|
|
|
|
|
|
require 'helper'
|
|
|
|
require 'vulcano/resource'
|
|
|
|
|
|
|
|
describe 'Vulcano::Resources::Bond' do
|
2015-09-22 16:31:21 +00:00
|
|
|
let(:resource) { load_resource('bond', 'bond0') }
|
2015-09-03 15:33:19 +00:00
|
|
|
|
2015-09-22 16:33:05 +00:00
|
|
|
it 'bond must be available' do
|
|
|
|
resource.exist?.must_equal true
|
|
|
|
end
|
2015-09-03 15:33:19 +00:00
|
|
|
|
2015-09-22 16:33:05 +00:00
|
|
|
it 'eth0 is part of bond' do
|
|
|
|
_(resource.has_interface?('eth0')).must_equal true
|
|
|
|
_(resource.has_interface?('eth1')).must_equal false
|
|
|
|
_(resource.has_interface?('eth2')).must_equal true
|
|
|
|
end
|
2015-09-03 15:33:19 +00:00
|
|
|
|
2015-09-22 16:33:05 +00:00
|
|
|
it 'get all interfaces' do
|
|
|
|
_(resource.interfaces).must_equal %w{eth0 eth2}
|
|
|
|
end
|
2015-09-03 15:33:19 +00:00
|
|
|
|
2015-09-22 16:33:05 +00:00
|
|
|
it 'get proc content' do
|
|
|
|
_(resource.content).wont_equal nil
|
|
|
|
_(resource.content).wont_equal ''
|
2015-09-03 15:33:19 +00:00
|
|
|
end
|
|
|
|
end
|