]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/nova/spec/classes/nova_compute_neutron_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / nova / spec / classes / nova_compute_neutron_spec.rb
1 require 'spec_helper'
2 describe 'nova::compute::neutron' do
3
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') }
7   end
8
9   context 'when overriding params' do
10     let :params do
11       {:libvirt_vif_driver => 'foo' }
12     end
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) }
15   end
16
17   context 'when overriding with a removed libvirt_vif_driver param' do
18     let :params do
19       {:libvirt_vif_driver => 'nova.virt.libvirt.vif.LibvirtOpenVswitchDriver' }
20     end
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/)
23     end
24   end
25
26   context 'with force_snat_range parameter set to false' do
27     let :params do
28       { :force_snat_range => false, }
29     end
30     it { should contain_nova_config('DEFAULT/force_snat_range').with_ensure('absent') }
31   end
32
33   context 'with force_snat_range parameter set to 10.0.0.0/24' do
34     let :params do
35       { :force_snat_range => '10.0.0.0/24', }
36     end
37
38     it { should contain_nova_config('DEFAULT/force_snat_range').with_value('10.0.0.0/24') }
39   end
40
41   context 'with force_snat_range parameter set to fe80::/64' do
42     let :params do
43       { :force_snat_range => 'fe80::/64', }
44     end
45
46     it { should contain_nova_config('DEFAULT/force_snat_range').with_value('fe80::/64') }
47   end
48
49   context 'with force_snat_range parameter set ip without mask' do
50     let :params do
51       { :force_snat_range => '10.0.0.0', }
52     end
53
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/) }
56   end
57
58 end