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

52 lines
1.3KB

  1. # frozen_string_literal: true
  2. control 'Php configuration' do
  3. title 'should match desired lines'
  4. # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
  5. def test_debian
  6. describe file('/etc/php/5.6/fpm/pool.d/radius-admin.conf') do
  7. its('content') { should include '[radius-admin]' }
  8. its('content') { should include 'php_admin_value[date.timezone] = Europe/Paris' }
  9. end
  10. describe file('/etc/php/7.3/fpm/pool.d/ldap-admin.conf') do
  11. its('content') { should include '[ldap-admin]' }
  12. its('content') { should include 'php_admin_value[date.timezone] = Europe/Paris' }
  13. end
  14. describe file('/etc/php/5.6/fpm/php.ini') do
  15. its('content') { should include 'date.timezone = Europe/Paris' }
  16. end
  17. describe file('/etc/php/7.3/fpm/php.ini') do
  18. its('content') { should include 'date.timezone = Europe/Paris' }
  19. end
  20. end
  21. # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
  22. def test_redhat; end
  23. def test_suse; end
  24. def test_bsd
  25. describe file('/usr/local/bin/composer') do
  26. it { should be_file }
  27. it { should be_owned_by 'root' }
  28. it { should be_grouped_into 'wheel' }
  29. its('mode') { should cmp '0755' }
  30. end
  31. end
  32. case os[:family]
  33. when 'debian'
  34. test_debian
  35. when 'redhat', 'fedora'
  36. test_redhat
  37. when 'suse'
  38. test_suse
  39. when 'bsd'
  40. test_bsd
  41. end
  42. end