diff options
author | duritong <peter.meier+github@immerda.ch> | 2014-01-25 06:22:18 -0800 |
---|---|---|
committer | duritong <peter.meier+github@immerda.ch> | 2014-01-25 06:22:18 -0800 |
commit | 21eeb6c772a2e8b362b6917694f169d5b2c7032d (patch) | |
tree | 5d851c42f824570900fa5896c50be65fe2d31632 /spec/classes/munin_host_cgi_spec.rb | |
parent | 09316f8abaa90b816be0c3dae35c86b41959bd2b (diff) | |
parent | 151b37a22ee5822101aa316d0c0620ad535c80d1 (diff) |
Merge pull request #30 from oxilion/file-cleanup
Clean up files by using templates
Diffstat (limited to 'spec/classes/munin_host_cgi_spec.rb')
-rw-r--r-- | spec/classes/munin_host_cgi_spec.rb | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/spec/classes/munin_host_cgi_spec.rb b/spec/classes/munin_host_cgi_spec.rb new file mode 100644 index 0000000..301f964 --- /dev/null +++ b/spec/classes/munin_host_cgi_spec.rb @@ -0,0 +1,57 @@ +require 'spec_helper' + +describe 'munin::host::cgi' do + #let :pre_condition do + # 'include munin::client' + #end + + context 'on Debian' do + let :facts do + { :operatingsystem => 'Debian' } + end + + it 'should compile' do + should include_class('munin::host::cgi') + end + + it 'should exec set_modes_for_cgi' do + should contain_exec('set_modes_for_cgi').with({ + :command => 'chgrp www-data /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R www-data {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + :refreshonly => true, + :subscribe => 'Concat::Fragment[munin.conf.header]', + }) + end + + it 'should contain logrotate.conf' do + should contain_file('/etc/logrotate.d/munin').with({ + :content => /^ create 660 munin www-data$/, + :group => 0, + :mode => '0644', + :owner => 'root', + }) + end + end + + context 'on CentOS' do + let :facts do + { :operatingsystem => 'CentOS' } + end + + it 'should exec set_modes_for_cgi' do + should contain_exec('set_modes_for_cgi').with({ + :command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + :refreshonly => true, + :subscribe => 'Concat::Fragment[munin.conf.header]', + }) + end + + it 'should contain logrotate.conf' do + should contain_file('/etc/logrotate.d/munin').with({ + :content => /^ create 660 munin apache$/, + :group => 0, + :mode => '0644', + :owner => 'root', + }) + end + end +end |