fuel-library/tests/noop/spec/hosts/cluster-vrouter/cluster-vrouter_spec.rb
Oleksiy Molchanov b036eea91b Add other_networks to vrouter ns
- Remove host interface creation from ns_ntp ocf
- Create new crm resource vrouter that handles other_networks
- Update direct_networks.rb to parse custom routes

Change-Id: Iea26e1755e7e6d6310ad7cdb77ef1b21d850ff36
Closes-Bug: 1436868
2015-04-24 10:11:33 +00:00

33 lines
832 B
Ruby

require 'spec_helper'
require 'shared-examples'
manifest = 'cluster-vrouter/cluster-vrouter.pp'
describe manifest do
shared_examples 'puppet catalogue' do
settings = Noop.fuel_settings
networks = []
settings['network_scheme']['endpoints'].each{ |k,v|
if v['IP'].is_a?(Array)
v['IP'].each { |ip|
networks << IPAddr.new(ip).to_s + "/" + ip.split('/')[1]
}
end
if v.has_key?('routes') and v['routes'].is_a?(Array)
v['routes'].each { |route|
networks << route['net']
}
end
}
it "should delcare cluster::vrouter_ocf with other_networks set to #{networks.join(' ')}" do
should contain_class('cluster::vrouter_ocf').with(
'other_networks' => networks.join(' '),
)
end
end
test_ubuntu_and_centos manifest
end