nginx_mail_spec.rb 915 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. require 'spec_helper_acceptance'
  2. describe "nginx::resource::mailhost define:" do
  3. it 'should run successfully' do
  4. pp = "
  5. class { 'nginx':
  6. mail => true,
  7. }
  8. nginx::resource::mailhost { 'domain1.example':
  9. ensure => present,
  10. auth_http => 'localhost/cgi-bin/auth',
  11. protocol => 'smtp',
  12. listen_port => 587,
  13. ssl => true,
  14. ssl_port => 465,
  15. ssl_cert => '/tmp/blah.cert',
  16. ssl_key => '/tmp/blah.key',
  17. xclient => 'off',
  18. }
  19. "
  20. apply_manifest(pp, :catch_failures => true)
  21. end
  22. describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
  23. it { is_expected.to be_file }
  24. it { is_expected.to contain "auth_http localhost/cgi-bin/auth;" }
  25. end
  26. describe port(587) do
  27. it { is_expected.to be_listening }
  28. end
  29. describe port(465) do
  30. it { is_expected.to be_listening }
  31. end
  32. end