mirror of
https://github.com/inspec/inspec
synced 2024-11-10 23:24:18 +00:00
add more unit test cases
This commit is contained in:
parent
b2ed180885
commit
74729f5779
1 changed files with 27 additions and 1 deletions
|
@ -7,7 +7,7 @@ require 'vulcano/resource'
|
|||
|
||||
describe 'Vulcano::Resources::Bridge' do
|
||||
|
||||
it 'check linux bridge' do
|
||||
it 'check linux bridge on ubuntu' do
|
||||
resource = MockLoader.new(:ubuntu1404).load_resource('bridge', 'br0')
|
||||
_(resource.exists?).must_equal true
|
||||
|
||||
|
@ -19,4 +19,30 @@ describe 'Vulcano::Resources::Bridge' do
|
|||
# get associated interfaces
|
||||
_(resource.interfaces).must_equal %w{eth1 eth2}
|
||||
end
|
||||
|
||||
it 'check linux bridge on centos 7' do
|
||||
resource = MockLoader.new(:centos7).load_resource('bridge', 'br0')
|
||||
_(resource.exists?).must_equal true
|
||||
|
||||
# check network interfaced attached to bridge
|
||||
_(resource.has_interface?('eth0')).must_equal false
|
||||
_(resource.has_interface?('eth1')).must_equal true
|
||||
_(resource.has_interface?('eth2')).must_equal true
|
||||
|
||||
# get associated interfaces
|
||||
_(resource.interfaces).must_equal %w{eth1 eth2}
|
||||
end
|
||||
|
||||
it 'check bridge on unsupported os' do
|
||||
resource = MockLoader.new(:undefined).load_resource('bridge', 'br0')
|
||||
_(resource.exists?).must_equal false
|
||||
|
||||
# check network interfaced attached to bridge
|
||||
_(resource.has_interface?('eth0')).must_equal false
|
||||
_(resource.has_interface?('eth1')).must_equal false
|
||||
_(resource.has_interface?('eth2')).must_equal false
|
||||
|
||||
# get associated interfaces
|
||||
_(resource.interfaces).must_equal nil
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue