puppet-cinder/spec/classes/cinder_volume_glusterfs_spec.rb
Maksym Yatsenko 4fcd49b592 Change worker defaults to ::os_workers
This patch changes the default worker count from ::processorcount to the
new ::os_workers fact. ::os_workers is based on the number of processors
(currently cpu/4) but is capped at a maximum of 8 worker processors.
This is a much more reasonable default in general and prevents excessive
resource consumption on systems with a large number of CPUs.

Change-Id: I159bb64d024c2207526c73212d68230d8362164c
2016-10-06 20:09:02 +03:00

56 lines
2.1 KiB
Ruby

require 'spec_helper'
describe 'cinder::volume::glusterfs' do
shared_examples_for 'glusterfs volume driver' do
let :params do
{
:glusterfs_shares => ['10.10.10.10:/volumes', '10.10.10.11:/volumes'],
:glusterfs_shares_config => '/etc/cinder/other_shares.conf',
:glusterfs_sparsed_volumes => true,
:glusterfs_mount_point_base => '/cinder_mount_point',
}
end
it 'configures glusterfs volume driver' do
is_expected.to contain_cinder_config('DEFAULT/volume_driver').with_value('cinder.volume.drivers.glusterfs.GlusterfsDriver')
is_expected.to contain_cinder_config('DEFAULT/glusterfs_shares_config').with_value('/etc/cinder/other_shares.conf')
is_expected.to contain_cinder_config('DEFAULT/glusterfs_sparsed_volumes').with_value(true)
is_expected.to contain_cinder_config('DEFAULT/glusterfs_mount_point_base').with_value('/cinder_mount_point')
is_expected.to contain_cinder_config('DEFAULT/glusterfs_backup_mount_point').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/glusterfs_backup_share').with_value('<SERVICE DEFAULT>')
is_expected.to contain_file('/etc/cinder/other_shares.conf').with(
:content => "10.10.10.10:/volumes\n10.10.10.11:/volumes\n",
:require => 'Anchor[cinder::install::end]',
:notify => 'Anchor[cinder::service::begin]'
)
end
context 'glusterfs volume driver with additional configuration' do
before do
params.merge!({:extra_options => {'glusterfs_backend/param1' => { 'value' => 'value1' }}})
end
it 'configure glusterfs volume with additional configuration' do
is_expected.to contain_cinder__backend__glusterfs('DEFAULT').with({
:extra_options => {'glusterfs_backend/param1' => {'value' => 'value1'}}
})
end
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts({:os_workers => 8}))
end
it_configures 'glusterfs volume driver'
end
end
end