2015-09-03 15:33:19 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
describe 'parse bond config' do
|
2015-09-03 16:03:51 +00:00
|
|
|
|
2015-09-03 15:33:19 +00:00
|
|
|
|
|
|
|
it 'bond must be available' do
|
2015-09-18 10:44:29 +00:00
|
|
|
resource.exist?.must_equal true
|
2015-09-03 15:33:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'eth0 is part of bond' do
|
2015-09-03 16:03:51 +00:00
|
|
|
_(resource.has_interface?('eth0')).must_equal true
|
|
|
|
_(resource.has_interface?('eth1')).must_equal false
|
|
|
|
_(resource.has_interface?('eth2')).must_equal true
|
2015-09-03 15:33:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'get all interfaces' do
|
2015-09-05 20:28:16 +00:00
|
|
|
_(resource.interfaces).must_equal %w{eth0 eth2}
|
2015-09-03 15:33:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'get proc content' do
|
2015-09-03 16:03:51 +00:00
|
|
|
_(resource.content).wont_equal nil
|
|
|
|
_(resource.content).wont_equal ''
|
2015-09-03 15:33:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|