2013-09-04 21:11:36 +02:00
|
|
|
require 'spec_helper_system'
|
|
|
|
|
|
|
|
describe "nginx::resource::mailhost define:" do
|
2013-12-01 01:08:28 +01:00
|
|
|
it 'should run successfully' do
|
2013-09-04 21:11:36 +02:00
|
|
|
|
|
|
|
pp = "
|
|
|
|
class { 'nginx':
|
|
|
|
mail => true,
|
|
|
|
}
|
|
|
|
nginx::resource::vhost { 'www.puppetlabs.com':
|
|
|
|
ensure => present,
|
|
|
|
www_root => '/var/www/www.puppetlabs.com',
|
|
|
|
}
|
|
|
|
nginx::resource::mailhost { 'domain1.example':
|
|
|
|
ensure => present,
|
|
|
|
auth_http => 'localhost/cgi-bin/auth',
|
|
|
|
protocol => 'smtp',
|
|
|
|
listen_port => 587,
|
|
|
|
ssl_port => 465,
|
|
|
|
xclient => 'off',
|
|
|
|
}
|
|
|
|
"
|
|
|
|
|
2013-12-01 01:08:28 +01:00
|
|
|
puppet_apply(pp) do |r|
|
|
|
|
[0,2].should include r.exit_code
|
|
|
|
r.refresh
|
2013-09-04 21:11:36 +02:00
|
|
|
# Not until deprecated variables fixed.
|
2013-12-01 01:08:28 +01:00
|
|
|
#r.stderr.should be_empty
|
|
|
|
r.exit_code.should be_zero
|
2013-09-04 21:11:36 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-12-01 01:49:41 +01:00
|
|
|
describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
|
2013-09-04 21:11:36 +02:00
|
|
|
it { should be_file }
|
|
|
|
it { should contain "auth_http localhost/cgi-bin/auth;" }
|
|
|
|
end
|
|
|
|
|
2013-12-01 01:51:31 +01:00
|
|
|
describe file('/etc/nginx/sites-available/www.puppetlabs.com.conf') do
|
|
|
|
it { should be_file }
|
|
|
|
end
|
|
|
|
|
2013-09-04 21:11:36 +02:00
|
|
|
end
|