|
|
@@ -1,18 +1,31 @@ |
|
|
|
control 'SyslogNG configuration' do |
|
|
|
title 'should match desired lines' |
|
|
|
|
|
|
|
describe file('/etc/syslog-ng/syslog-ng.conf') do |
|
|
|
# # Default config |
|
|
|
# its('content') { should include '[inputs.diskio]' } |
|
|
|
# its('content') { should include '[inputs.kernel]' } |
|
|
|
# its('content') { should include '[inputs.mem]' } |
|
|
|
# its('content') { should include '[inputs.processes]' } |
|
|
|
# its('content') { should include '[inputs.swap]' } |
|
|
|
# its('content') { should include '[inputs.system]' } |
|
|
|
str = |
|
|
|
''' |
|
|
|
source s_src { |
|
|
|
internal(); |
|
|
|
}; |
|
|
|
|
|
|
|
destination d_syslog { |
|
|
|
file("/var/log/syslog"); |
|
|
|
}; |
|
|
|
|
|
|
|
filter f_syslog3 { |
|
|
|
not level(debug); |
|
|
|
}; |
|
|
|
|
|
|
|
# # Custom config from pillar (default: nothing) |
|
|
|
# its('content') { should include '[outputs.discard]' } |
|
|
|
log { |
|
|
|
source(s_src); |
|
|
|
filter(f_syslog3); |
|
|
|
destination(d_syslog); |
|
|
|
}; |
|
|
|
''' |
|
|
|
|
|
|
|
describe file('/etc/syslog-ng/syslog-ng.conf') do |
|
|
|
it { should exist } |
|
|
|
|
|
|
|
# Custom config from pillar |
|
|
|
its('content') { should include str } |
|
|
|
end |
|
|
|
end |