You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing a new cookbook and validating its configuration with kitchen-inspec. I am using a postgres_session resource to make sure a postgresql parameter was set properly. I know that this can be done with the postgres_conf resource, but I am trying to make sure that the postgres_session resource works so that I can use it to run more complex queries against my database.
The following inspec test fails ...
database_test_spec.rb
postgres = postgres_session('postgres', 'pass')
describe postgres.query('show ssl;') do
its('output') { should eq(" ssl\n -----\n on\n (1 row)\n ") }
end
expected: " ssl\n -----\n on\n (1 row)\n "
got: output to some stream
(compared using ==)
Diff:
@@ -1,6 +1,2 @@
- ssl
- -----
- on
- (1 row)
-
+(output to some stream)
# ./test/integration/standard_database_setup94/database_test_spec.rb:20:in `block (2 levels) in load'
# /Users/foo/.chefdk/gem/ruby/2.1.0/gems/inspec-0.9.5/lib/inspec/runner.rb:97:in `run_with'
# /Users/foo/.chefdk/gem/ruby/2.1.0/gems/inspec-0.9.5/lib/inspec/runner.rb:93:in `run'
I am using inspec (0.9.5) and kitchen-inspec (0.9.0)
I don't understand what I am doing wrong here. Am I using this resource incorrectly, or is this some sort of bug on my end? Any help would be much appreciated.
The text was updated successfully, but these errors were encountered:
@paulmakl thanks for reporting this. Currently, there is some magic in place that will prepare the output from psql for matching. So, to match what you're aiming at, you'd just write
However, I had some trouble with this resource acting strange when there was a failure in the psql command executing, started working on that here. Also tracked down "output to some stream".
I am writing a new cookbook and validating its configuration with kitchen-inspec. I am using a postgres_session resource to make sure a postgresql parameter was set properly. I know that this can be done with the postgres_conf resource, but I am trying to make sure that the postgres_session resource works so that I can use it to run more complex queries against my database.
The following inspec test fails ...
database_test_spec.rb
postgres = postgres_session('postgres', 'pass')
describe postgres.query('show ssl;') do
its('output') { should eq(" ssl\n -----\n on\n (1 row)\n ") }
end
... with the following output.
Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }
I am using inspec (0.9.5) and kitchen-inspec (0.9.0)
I don't understand what I am doing wrong here. Am I using this resource incorrectly, or is this some sort of bug on my end? Any help would be much appreciated.
The text was updated successfully, but these errors were encountered: