2014-10-03 22:48:07 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'puppetdb::server', :type => :class do
|
|
|
|
basefacts =
|
|
|
|
{
|
|
|
|
:osfamily => 'RedHat',
|
|
|
|
:operatingsystem => 'RedHat',
|
|
|
|
:operatingsystemrelease => '6.5',
|
2015-06-17 21:42:04 +02:00
|
|
|
:fqdn => 'test.domain.local',
|
|
|
|
:kernel => 'Linux',
|
2016-04-20 15:55:26 +02:00
|
|
|
:selinux => true,
|
2014-10-03 22:48:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
context 'on a supported platform' do
|
|
|
|
let(:facts) do
|
|
|
|
basefacts
|
|
|
|
end
|
|
|
|
|
2016-04-28 13:39:54 +02:00
|
|
|
describe 'when using default values' do
|
|
|
|
it { should contain_class('puppetdb::server') }
|
|
|
|
it { should contain_class('puppetdb::server::global') }
|
|
|
|
it { should contain_class('puppetdb::server::command_processing') }
|
|
|
|
it { should contain_class('puppetdb::server::database') }
|
|
|
|
it { should contain_class('puppetdb::server::read_database') }
|
|
|
|
it { should contain_class('puppetdb::server::jetty') }
|
|
|
|
it { should contain_class('puppetdb::server::puppetdb') }
|
|
|
|
end
|
2014-10-03 22:48:07 +02:00
|
|
|
|
|
|
|
describe 'when not specifying JAVA_ARGS' do
|
|
|
|
it { should_not contain_ini_subsetting('Xms') }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when specifying JAVA_ARGS' do
|
|
|
|
let(:params) do
|
|
|
|
{
|
|
|
|
'java_args' => {
|
|
|
|
'-Xms' => '2g',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on standard PuppetDB' do
|
|
|
|
it { should contain_ini_subsetting("'-Xms'").
|
|
|
|
with(
|
|
|
|
'ensure' => 'present',
|
|
|
|
'path' => '/etc/sysconfig/puppetdb',
|
|
|
|
'section' => '',
|
|
|
|
'key_val_separator' => '=',
|
|
|
|
'setting' => 'JAVA_ARGS',
|
|
|
|
'subsetting' => '-Xms',
|
|
|
|
'value' => '2g'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2015-09-21 23:23:12 +02:00
|
|
|
|
|
|
|
describe 'when specifying JAVA_ARGS with merge_default_java_args false' do
|
|
|
|
let (:params) do
|
|
|
|
{
|
|
|
|
'java_args' => {'-Xms' => '2g'},
|
|
|
|
'merge_default_java_args' => false,
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on standard PuppetDB' do
|
|
|
|
it { should contain_ini_setting('java_args').
|
|
|
|
with(
|
|
|
|
'ensure' => 'present',
|
|
|
|
'path' => '/etc/sysconfig/puppetdb',
|
|
|
|
'section' => '',
|
|
|
|
'setting' => 'JAVA_ARGS',
|
|
|
|
'value' => '"-Xms2g"'
|
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
2014-10-03 22:48:07 +02:00
|
|
|
end
|
|
|
|
end
|