Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/postgres_session: add integration tests, change error handling
this makes it work (tested with default-ubuntu-1404), but doesn't improve the error handling (i.e., the skip_resource doesn't really prevent the failure)
- Loading branch information
Showing
5 changed files
with
33 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
version '1.0.0' | ||
depends 'apt' | ||
depends 'yum' | ||
depends 'postgresql' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# encoding: utf-8 | ||
# author: Stephan Renatus | ||
# | ||
# installs everyting for the postgres tests | ||
|
||
# hw-cookbooks/postgresql is tested on these platforms | ||
case node['platform'] | ||
when 'ubuntu', 'centos' | ||
node.default['postgresql']['config']['listen_addresses'] = 'localhost' | ||
node.default['postgresql']['password']['postgres'] = 'md506be11be01439cb4abd537e454df34ea' # "inspec" | ||
include_recipe 'postgresql::server' | ||
end |
9 changes: 9 additions & 0 deletions
9
test/integration/test/integration/default/postgres_session_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# encoding: utf-8 | ||
|
||
# postgres-server is installed on these platforms | ||
if ['ubuntu', 'centos'].include? os['family'] | ||
postgres = postgres_session('postgres', 'inspec') | ||
describe postgres.query('show ssl;') do | ||
its('output') { should eq 'on' } | ||
end | ||
end |