Skip to content

Commit

Permalink
beaker: add some more basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex authored and Matthew Haughton committed Apr 14, 2015
1 parent d6b20fb commit 8eb3bf2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

describe service('nginx') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

end
11 changes: 11 additions & 0 deletions spec/acceptance/nginx_mail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class { 'nginx':
auth_http => 'localhost/cgi-bin/auth',
protocol => 'smtp',
listen_port => 587,
ssl => true,
ssl_port => 465,
ssl_cert => '/tmp/blah.cert',
ssl_key => '/tmp/blah.key',
xclient => 'off',
}
"
Expand All @@ -25,4 +28,12 @@ class { 'nginx':
it { is_expected.to contain "auth_http localhost/cgi-bin/auth;" }
end

describe port(587) do
it { is_expected.to be_listening }
end

describe port(465) do
it { is_expected.to be_listening }
end

end
8 changes: 8 additions & 0 deletions spec/acceptance/nginx_vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class { 'nginx': }
describe service('nginx') do
it { is_expected.to be_running }
end

describe port(80) do
it { is_expected.to be_listening }
end

it 'should answer to www.puppetlabs.com' do
shell("/usr/bin/curl http://www.puppetlabs.com:80") do |r|
Expand Down Expand Up @@ -72,6 +76,10 @@ class { 'nginx': }
it { is_expected.to be_running }
end

describe port(443) do
it { is_expected.to be_listening }
end

it 'should answer to http://www.puppetlabs.com' do
shell("/usr/bin/curl http://www.puppetlabs.com:80") do |r|
expect(r.stdout).to eq("Hello from www\n")
Expand Down

0 comments on commit 8eb3bf2

Please sign in to comment.