2015-04-08 16:29:03 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'puppetdb::server::config_ini', :type => :class do
|
|
|
|
context 'on a supported platform' do
|
|
|
|
let(:facts) do
|
|
|
|
{
|
|
|
|
:osfamily => 'OpenBSD',
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it { should contain_class('puppetdb::server::config_ini') }
|
|
|
|
|
|
|
|
describe 'when using default values' do
|
2015-06-18 22:45:51 +02:00
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_threads').
|
|
|
|
with(
|
|
|
|
'ensure' => 'absent',
|
|
|
|
'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini',
|
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'threads'
|
|
|
|
)}
|
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_store_usage').
|
|
|
|
with(
|
|
|
|
'ensure' => 'absent',
|
|
|
|
'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini',
|
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'store-usage'
|
|
|
|
)}
|
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_temp_usage').
|
|
|
|
with(
|
|
|
|
'ensure' => 'absent',
|
|
|
|
'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini',
|
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'temp-usage'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when using legacy PuppetDB' do
|
|
|
|
let (:pre_condition) { 'class { "puppetdb::globals": version => "2.2.0", }' }
|
2015-04-08 16:29:03 +02:00
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_threads').
|
|
|
|
with(
|
|
|
|
'ensure' => 'absent',
|
|
|
|
'path' => '/etc/puppetdb/conf.d/config.ini',
|
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'threads'
|
|
|
|
)}
|
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_store_usage').
|
|
|
|
with(
|
|
|
|
'ensure' => 'absent',
|
|
|
|
'path' => '/etc/puppetdb/conf.d/config.ini',
|
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'store-usage'
|
|
|
|
)}
|
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_temp_usage').
|
|
|
|
with(
|
|
|
|
'ensure' => 'absent',
|
|
|
|
'path' => '/etc/puppetdb/conf.d/config.ini',
|
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'temp-usage'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when using custom values' do
|
|
|
|
let(:params) do
|
|
|
|
{
|
|
|
|
'command_threads' => 10,
|
|
|
|
'store_usage' => 4000,
|
|
|
|
'temp_usage' => 2000,
|
|
|
|
}
|
|
|
|
end
|
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_threads').
|
|
|
|
with(
|
|
|
|
'ensure' => 'present',
|
2015-06-18 22:45:51 +02:00
|
|
|
'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini',
|
2015-04-08 16:29:03 +02:00
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'threads',
|
|
|
|
'value' => '10'
|
|
|
|
)}
|
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_store_usage').
|
|
|
|
with(
|
|
|
|
'ensure' => 'present',
|
2015-06-18 22:45:51 +02:00
|
|
|
'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini',
|
2015-04-08 16:29:03 +02:00
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'store-usage',
|
|
|
|
'value' => '4000'
|
|
|
|
)}
|
|
|
|
it { should contain_ini_setting('puppetdb_config_command_processing_temp_usage').
|
|
|
|
with(
|
|
|
|
'ensure' => 'present',
|
2015-06-18 22:45:51 +02:00
|
|
|
'path' => '/etc/puppetlabs/puppetdb/conf.d/config.ini',
|
2015-04-08 16:29:03 +02:00
|
|
|
'section' => 'command-processing',
|
|
|
|
'setting' => 'temp-usage',
|
|
|
|
'value' => '2000'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|