2 describe 'nova::compute::neutron' do
4 context 'with default parameters' do
5 it { should contain_nova_config('libvirt/vif_driver').with_value('nova.virt.libvirt.vif.LibvirtGenericVIFDriver')}
6 it { should contain_nova_config('DEFAULT/force_snat_range').with(:value => '0.0.0.0/0') }
9 context 'when overriding params' do
11 {:libvirt_vif_driver => 'foo' }
13 it { should contain_nova_config('libvirt/vif_driver').with_value('foo')}
14 it { should contain_nova_config('DEFAULT/force_snat_range').with_ensure(:absent) }
17 context 'when overriding with a removed libvirt_vif_driver param' do
19 {:libvirt_vif_driver => 'nova.virt.libvirt.vif.LibvirtOpenVswitchDriver' }
21 it 'should fails to configure libvirt_vif_driver with old OVS driver' do
22 expect { subject }.to raise_error(Puppet::Error, /nova.virt.libvirt.vif.LibvirtOpenVswitchDriver as vif_driver is removed from Icehouse/)
26 context 'with force_snat_range parameter set to false' do
28 { :force_snat_range => false, }
30 it { should contain_nova_config('DEFAULT/force_snat_range').with_ensure('absent') }
33 context 'with force_snat_range parameter set to 10.0.0.0/24' do
35 { :force_snat_range => '10.0.0.0/24', }
38 it { should contain_nova_config('DEFAULT/force_snat_range').with_value('10.0.0.0/24') }
41 context 'with force_snat_range parameter set to fe80::/64' do
43 { :force_snat_range => 'fe80::/64', }
46 it { should contain_nova_config('DEFAULT/force_snat_range').with_value('fe80::/64') }
49 context 'with force_snat_range parameter set ip without mask' do
51 { :force_snat_range => '10.0.0.0', }
54 it { expect { should contain_nova_config('DEFAULT/force_snat_range') }.to \
55 raise_error(Puppet::Error, /force_snat_range should be IPv4 or IPv6/) }