nginx_mail_spec.rb 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. require 'spec_helper_system'
  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::vhost { 'www.puppetlabs.com':
  9. ensure => present,
  10. www_root => '/var/www/www.puppetlabs.com',
  11. }
  12. nginx::resource::mailhost { 'domain1.example':
  13. ensure => present,
  14. auth_http => 'localhost/cgi-bin/auth',
  15. protocol => 'smtp',
  16. listen_port => 587,
  17. ssl_port => 465,
  18. xclient => 'off',
  19. }
  20. "
  21. puppet_apply(pp) do |r|
  22. [0,2].should include r.exit_code
  23. r.refresh
  24. # Not until deprecated variables fixed.
  25. #r.stderr.should be_empty
  26. r.exit_code.should be_zero
  27. end
  28. end
  29. describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
  30. it { should be_file }
  31. it { should contain "auth_http localhost/cgi-bin/auth;" }
  32. end
  33. describe file('/etc/nginx/sites-available/www.puppetlabs.com.conf') do
  34. it { should be_file }
  35. end
  36. end