Saltstack Official Logrotate Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
695B

  1. # encoding: utf-8
  2. title 'Test logrotate installation'
  3. describe package('logrotate') do
  4. it { should be_installed }
  5. end
  6. describe file('/etc/logrotate.conf') do
  7. it { should exist }
  8. it { should be_owned_by 'root' }
  9. it { should be_grouped_into 'root' }
  10. its('mode') { should cmp '0644' }
  11. end
  12. describe file('/etc/logrotate.d') do
  13. it { should be_directory }
  14. it { should be_owned_by 'root' }
  15. it { should be_grouped_into 'root' }
  16. its('mode') { should cmp '0755' }
  17. end
  18. case os[:name]
  19. when 'redhat', 'centos', 'fedora'
  20. service = 'crond'
  21. else
  22. service = 'cron'
  23. end
  24. describe service(service) do
  25. it { should be_installed }
  26. it { should be_enabled }
  27. it { should be_running }
  28. end