Skip to content

Commit 1903c05

Browse files
add test for rollingFile and dailyRollingFile
1 parent 2e06481 commit 1903c05

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

spec/classes/000_elasticsearch_init_spec.rb

+25
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,31 @@
397397
it { should contain_file('/var/run/elasticsearch').with(:owner => 'myesuser') } if facts[:osfamily] == 'RedHat'
398398
end
399399

400+
context "rollingFile appender" do
401+
402+
let (:params) {
403+
default_params.merge({
404+
:file_rolling_type => 'rollingFile',
405+
:rolling_file_max_backup_index => 10,
406+
:rolling_file_max_file_size => '100MB',
407+
:instances => { 'test' => {} }
408+
})
409+
}
410+
411+
it { should contain_file('/etc/elasticsearch/test/logging.yml').with_content(/type: rollingFile/, /maxBackupIndex: 10/, /maxBackupIndex: 10/, /maxFileSize: 100MB/) }
412+
end
413+
414+
context "Default file appender" do
415+
416+
let (:params) {
417+
default_params.merge({
418+
:instances => { 'test' => {} }
419+
})
420+
}
421+
422+
it { should contain_file('/etc/elasticsearch/test/logging.yml').with_content(/type: dailyRollingFile/, /datePattern: "'.'yyyy-MM-dd"/) }
423+
end
424+
400425
end
401426

402427
end

0 commit comments

Comments
 (0)