Files
puppet-nova/spec/classes/nova_compute_spec.rb
Daniel Gollub a77465076a Support network_device_mtu of nova managed interfaces
network_device_mtu configure the MTU for nova managed network interfaces.
By default no specific network_device_mtu configuration is set. The
interface defaults will be used as they got created.

This options allows configuration of Jumbo Frame usage.

Change-Id: Ia391f3daa788c780c4492071a480052b4ef4cc37
2013-12-21 18:48:29 +01:00

116 lines
3.2 KiB
Ruby

require 'spec_helper'
describe 'nova::compute' do
let :pre_condition do
'include nova'
end
describe 'with required params provided' do
let :params do
{
:vncproxy_host => '127.0.0.1',
:neutron_enabled => true
}
end
describe 'on debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it { should contain_nova_config('DEFAULT/vnc_enabled').with_value(true) }
it { should contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1') }
it { should contain_nova_config('DEFAULT/novncproxy_base_url').with_value(
'http://127.0.0.1:6080/vnc_auto.html'
) }
it { should contain_nova_config('DEFAULT/network_device_mtu').with('ensure' => 'absent') }
it { should contain_service('nova-compute').with(
'name' => 'nova-compute',
'ensure' => 'stopped',
'hasstatus' => true,
'enable' => false
)}
it { should contain_package('nova-compute').with(
'name' => 'nova-compute',
'ensure' => 'present',
'notify' => 'Service[nova-compute]'
) }
it { should_not contain_package('bridge-utils').with(
:ensure => 'present',
:before => 'Nova::Generic_service[compute]'
) }
it { should contain_package('pm-utils').with(
:ensure => 'present'
) }
describe 'with vnc_enabled set to true' do
let :params do
{
:enabled => true,
:vncproxy_host => '127.0.0.1'
}
end
it { should contain_service('nova-compute').with(
'name' => 'nova-compute',
'ensure' => 'running',
'hasstatus' => true,
'enable' => true
)}
end
describe 'with vnc_enabled set to false' do
let :params do
{:vnc_enabled => false}
end
it { should contain_nova_config('DEFAULT/vnc_enabled').with_value(false) }
it { should contain_nova_config('DEFAULT/vncserver_proxyclient_address').with_value('127.0.0.1')}
it { should_not contain_nova_config('DEFAULT/novncproxy_base_url') }
end
describe 'with force_config_drive set to true' do
let :params do
{:force_config_drive => true}
end
it { should contain_nova_config('DEFAULT/force_config_drive').with_value('true') }
end
describe 'with network_device_mtu specified' do
let :params do
{:network_device_mtu => 9999}
end
it { should contain_nova_config('DEFAULT/network_device_mtu').with_value('9999') }
end
describe 'with package version' do
let :params do
{:ensure_package => '2012.1-2'}
end
it { should contain_package('nova-compute').with(
'ensure' => '2012.1-2'
)}
end
end
describe 'on rhel' do
let :facts do
{ :osfamily => 'RedHat' }
end
it { should contain_service('nova-compute').with(
'name' => 'openstack-nova-compute',
'ensure' => 'stopped',
'hasstatus' => true,
'enable' => false
)}
it { should contain_package('nova-compute').with_name('openstack-nova-compute') }
end
end
end