module-icingaweb2/spec/classes/icingaweb2_mod_monitoring_spec.rb
Peter Souter a6cb42215a Fixes permissions on config files
Before ini_file was used to create the files, but the permissions were incorrect and you'd get an error message: ![Error](https://cloud.githubusercontent.com/assets/1064715/13003982/91bfc7ea-d170-11e5-9eb4-4fc135140f83.png)
2016-02-12 10:11:23 +00:00

63 lines
1.5 KiB
Ruby

require 'spec_helper'
describe 'icingaweb2::mod::monitoring', :type => :class do
let (:pre_condition) { '$concat_basedir = "/tmp"' }
let (:facts) { debian_facts }
let :pre_condition do
'include ::icingaweb2'
end
describe 'without parameters' do
[
'backends',
'config',
'commandtransports',
].each do | config_file |
it {
should contain_file("/etc/icingaweb2/modules/monitoring/#{config_file}.ini").
with(
{
'owner' => 'icingaweb2',
'group' => 'icingaweb2',
'mode' => '0644',
}
)
}
end
it { should contain_ini_setting('security settings').with(
'section' => /security/,
'setting' => /protected_customvars/,
'value' => /community/,
'path' => /config.ini/
)
}
it { should contain_ini_setting('backend ido setting').with(
'section' => /icinga_ido/,
'setting' => /type/,
'value' => /ido/,
'path' => /backends.ini/
)
}
it { should contain_ini_setting('backend resource setting').with(
'section' => /icinga_ido/,
'setting' => /resource/,
'value' => /icinga_ido/,
'path' => /backends.ini/
)
}
it { should contain_ini_setting('command transport setting').with(
'section' => /icinga2/,
'setting' => /transport/,
'value' => /local/,
'path' => /commandtransports.ini/
)
}
end
end