puppet-openstack-cloud/spec/classes/cloud_object_ringbuilder_spec.rb
Emilien Macchi ff448f8733 swift/ringbuilder: allow to disable the ring building
When using Hiera, it's usefull to have the "enabled" parameter to either
enable or disable the ring building, since it should be run on one
single node.

Signed-off-by: Emilien Macchi <emilien.macchi@enovance.com>
2014-06-11 13:54:30 +02:00

59 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'cloud::object::ringbuilder' do
shared_examples_for 'openstack swift ringbuilder' do
let :params do
{
:rsyncd_ipaddress => '127.0.0.1',
:replicas => 3,
:swift_rsync_max_connections => 5,
:enabled => true
}
end
it 'create the three rings' do
should contain_class('swift::ringbuilder').with({
'part_power' => '15',
'replicas' => '3',
'min_part_hours' => '24',
})
end
it 'create the ring rsync server' do
should contain_class('swift::ringserver').with({
'local_net_ip' => '127.0.0.1',
'max_connections' => '5',
})
end
context 'when ringbuilder is not enabled' do
before do
params.merge!(
:enabled => false
)
end
it 'should not configure swift ring builder' do
should_not contain_class('swift::ringbuilder')
end
end
end
context 'on Debian platforms' do
let :facts do
{ :osfamily => 'Debian' }
end
it_configures 'openstack swift ringbuilder'
end
context 'on RedHat platforms' do
let :facts do
{ :osfamily => 'RedHat' }
end
it_configures 'openstack swift ringbuilder'
end
end