Saltstack Official PHP Formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

68 lines
1.3KB

  1. # frozen_string_literal: true
  2. control 'Php package' do
  3. title 'should be installed'
  4. # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
  5. def test_debian
  6. describe package('php-imagick') do
  7. it { should be_installed }
  8. end
  9. describe package('php-redis') do
  10. it { should be_installed }
  11. end
  12. describe package('php-xdebug') do
  13. it { should be_installed }
  14. end
  15. %w[
  16. bz2 cli curl fpm gd imap intl mbstring
  17. mysql readline xml zip
  18. ].each do |pkg|
  19. describe package("php5.6-#{pkg}") do
  20. it { should be_installed }
  21. end
  22. describe package("php7.3-#{pkg}") do
  23. it { should be_installed }
  24. end
  25. end
  26. end
  27. # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
  28. def test_redhat
  29. describe package('php') do
  30. it { should be_installed }
  31. end
  32. end
  33. def test_suse
  34. describe package('php7') do
  35. it { should be_installed }
  36. end
  37. end
  38. def test_bsd
  39. %w[
  40. php74 php74-filter php74-json php74-mbstring php74-openssl php74-phar
  41. ].each do |pkg|
  42. describe package(pkg) do
  43. it { should be_installed }
  44. end
  45. end
  46. end
  47. case os[:family]
  48. when 'debian'
  49. test_debian
  50. when 'redhat', 'fedora'
  51. test_redhat
  52. when 'suse'
  53. test_suse
  54. when 'bsd'
  55. test_bsd
  56. end
  57. end