Saltstack Official Apache 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.

server_status_spec.rb 956B

123456789101112131415161718192021222324252627282930313233343536
  1. # frozen_string_literal: true
  2. control 'apache server_status configuration' do
  3. title 'should match desired lines'
  4. server_status_stanza = <<~SS_STANZA
  5. <Location "/server-status">
  6. SetHandler server-status
  7. Require local
  8. Require host foo.example.com
  9. Require ip 10.8.8.0/24
  10. </Location>
  11. SS_STANZA
  12. confdir =
  13. case platform[:family]
  14. when 'debian'
  15. '/etc/apache2/conf-available'
  16. when 'redhat', 'fedora'
  17. '/etc/httpd/conf.d'
  18. when 'suse'
  19. '/etc/apache2/conf.d'
  20. # `linux` here is sufficient for `arch`
  21. when 'linux'
  22. '/etc/httpd/conf/extra'
  23. end
  24. describe file("#{confdir}/server-status.conf") do
  25. it { should be_file }
  26. it { should be_owned_by 'root' }
  27. it { should be_grouped_into 'root' }
  28. its('mode') { should cmp '0644' }
  29. its('content') { should include '# File managed by Salt' }
  30. its('content') { should include server_status_stanza }
  31. end
  32. end