2015-04-06 04:53:52 +02:00
|
|
|
require 'spec_helper_acceptance'
|
2013-09-04 21:11:36 +02:00
|
|
|
|
|
|
|
describe "nginx::resource::upstream 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': }
|
|
|
|
nginx::resource::upstream { 'puppet_rack_app':
|
|
|
|
ensure => present,
|
|
|
|
members => [
|
|
|
|
'localhost:3000',
|
|
|
|
'localhost:3001',
|
|
|
|
'localhost:3002',
|
|
|
|
],
|
|
|
|
}
|
|
|
|
nginx::resource::vhost { 'rack.puppetlabs.com':
|
|
|
|
ensure => present,
|
|
|
|
proxy => 'http://puppet_rack_app',
|
|
|
|
}
|
|
|
|
"
|
|
|
|
|
2015-04-06 04:53:52 +02:00
|
|
|
apply_manifest(pp, :catch_failures => true)
|
2013-09-04 21:11:36 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
describe file('/etc/nginx/conf.d/puppet_rack_app-upstream.conf') do
|
2015-04-07 01:43:50 +02:00
|
|
|
it { is_expected.to be_file }
|
|
|
|
it { is_expected.to contain "server localhost:3000" }
|
|
|
|
it { is_expected.to contain "server localhost:3001" }
|
|
|
|
it { is_expected.to contain "server localhost:3002" }
|
|
|
|
it { is_expected.not_to contain "server localhost:3003" }
|
2013-09-04 21:11:36 +02:00
|
|
|
end
|
|
|
|
|
2013-12-01 01:51:31 +01:00
|
|
|
describe file('/etc/nginx/sites-available/rack.puppetlabs.com.conf') do
|
2015-04-07 01:43:50 +02:00
|
|
|
it { is_expected.to be_file }
|
|
|
|
it { is_expected.to contain "proxy_pass http://puppet_rack_app;" }
|
2013-09-04 21:11:36 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|