Skip to content

Commit f551ded

Browse files
author
Filip Krahl
committed
check database parameters instead of config file - logging params
Signed-off-by: Filip Krahl <filip.krahl@t-systems.com>
1 parent 43efb1e commit f551ded

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

controls/postgres_spec.rb

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,26 @@
279279
impact 1.0
280280
title 'Enable logging functions'
281281
desc 'Logging functions must be turned on and properly configured according / compliant to local law.'
282-
describe postgres_conf(POSTGRES_CONF_PATH) do
283-
its('logging_collector') { should eq 'on' }
284-
its('log_connections') { should eq 'on' }
285-
its('log_disconnections') { should eq 'on' }
286-
its('log_duration') { should eq 'on' }
287-
its('log_hostname') { should eq 'on' }
288-
its('log_directory') { should_not eq ' ' }
289-
its('log_line_prefix') { should eq '%t %u %d %h' }
282+
describe postgres_session(USER, PASSWORD).query('SHOW logging_collector;') do
283+
its('output') { should eq 'on' }
284+
end
285+
describe postgres_session(USER, PASSWORD).query('SHOW log_connections;') do
286+
its('output') { should eq 'on' }
287+
end
288+
describe postgres_session(USER, PASSWORD).query('SHOW log_disconnections;') do
289+
its('output') { should eq 'on' }
290+
end
291+
describe postgres_session(USER, PASSWORD).query('SHOW log_duration;') do
292+
its('output') { should eq 'on' }
293+
end
294+
describe postgres_session(USER, PASSWORD).query('SHOW log_hostname;') do
295+
its('output') { should eq 'on' }
296+
end
297+
describe postgres_session(USER, PASSWORD).query('SHOW log_directory;') do
298+
its('output') { should eq 'on' }
299+
end
300+
describe postgres_session(USER, PASSWORD).query('SHOW log_line_prefix;') do
301+
its('output') { should eq 'on' }
290302
end
291303
end
292304

0 commit comments

Comments
 (0)