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.

base.rb 814B

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