Files
puppet-nova/spec/classes/nova_network_vlan_spec.rb
Dan Bode c9757ec448 require sections are specified in nova_config
This massive code commit actually implements something very simple.

previously, we allowed nova_config to omit a section and assumed that
section was default.

This commit updates the code to require section names for all settings.

This change is being made b/c:
- it better maps to the config on disk
- it is consistent with the other modules

Change-Id: Iae71a4c48ed0f9792566f16f0bf13e61569b46e5
2013-04-12 15:06:58 -07:00

48 lines
2.0 KiB
Ruby

require 'spec_helper'
describe 'nova::network::vlan' do
describe 'with only required parameters' do
let :params do
{
:vlan_interface => 'eth1',
:fixed_range => '10.0.0.0/32'
}
end
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
it { should_not contain_nova_config('DEFAULT/public_interface') }
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
it { should contain_nova_config('DEFAULT/vlan_start').with_value('300') }
it { should contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value('true') }
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/nova-dhcpbridge') }
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova.conf') }
end
describe 'with parameters overridden' do
let :params do
{
:vlan_interface => 'eth1',
:fixed_range => '10.0.0.0/32',
:public_interface => 'eth0',
:vlan_start => '100',
:force_dhcp_release => false,
:dhcpbridge => '/usr/bin/dhcpbridge',
:dhcpbridge_flagfile => '/etc/nova/nova-dhcp.conf'
}
end
it { should contain_nova_config('DEFAULT/network_manager').with_value('nova.network.manager.VlanManager') }
it { should contain_nova_config('DEFAULT/public_interface').with_value('eth0') }
it { should contain_nova_config('DEFAULT/fixed_range').with_value('10.0.0.0/32') }
it { should contain_nova_config('DEFAULT/vlan_start').with_value('100') }
it { should contain_nova_config('DEFAULT/vlan_interface').with_value('eth1') }
it { should contain_nova_config('DEFAULT/force_dhcp_release').with_value('false') }
it { should contain_nova_config('DEFAULT/dhcpbridge').with_value('/usr/bin/dhcpbridge') }
it { should contain_nova_config('DEFAULT/dhcpbridge_flagfile').with_value('/etc/nova/nova-dhcp.conf') }
end
end