Skip to content

Commit

Permalink
config: test: Assert parametrs at once
Browse files Browse the repository at this point in the history
Co-authored-by: Takuro Ashie <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 and ashie committed May 18, 2022
1 parent 6574387 commit 389bc72
Showing 1 changed file with 33 additions and 20 deletions.
53 changes: 33 additions & 20 deletions test/test_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,26 +202,39 @@ def test_included
fluent_log_conf = label_conf.elements.first
fluent_log_buffer_conf = fluent_log_conf.elements.first

assert_equal 'dummy', dummy_source_conf['@type']
assert_equal 'tag.dummy', dummy_source_conf['tag']

assert_equal 'tcp', tcp_source_conf['@type']
assert_equal 'tag.tcp', tcp_source_conf['tag']

assert_equal 'none', parse_tcp_conf['@type']
assert_equal 'why.parse.section.doesnot.have.arg,huh', parse_tcp_conf.arg

assert_equal 'stdout', match_conf['@type']
assert_equal 'tag.*', match_conf.arg

assert_equal 'null', fluent_log_conf['@type']
assert_equal '**', fluent_log_conf.arg

assert_equal '@FLUENT_LOG', label_conf.arg

assert_equal 'memory', fluent_log_buffer_conf['@type']
assert_equal 'interval', fluent_log_buffer_conf['flush_mode']
assert_equal '1s', fluent_log_buffer_conf['flush_interval']
assert_equal(
[
'dummy',
'tag.dummy',
'tcp',
'tag.tcp',
'none',
'why.parse.section.doesnot.have.arg,huh',
'stdout',
'tag.*',
'null',
'**',
'@FLUENT_LOG',
'memory',
'interval',
'1s',
],
[
dummy_source_conf['@type'],
dummy_source_conf['tag'],
tcp_source_conf['@type'],
tcp_source_conf['tag'],
parse_tcp_conf['@type'],
parse_tcp_conf.arg,
match_conf['@type'],
match_conf.arg,
fluent_log_conf['@type'],
fluent_log_conf.arg,
label_conf.arg,
fluent_log_buffer_conf['@type'],
fluent_log_buffer_conf['flush_mode'],
fluent_log_buffer_conf['flush_interval'],
])
end

def test_check_not_fetchd
Expand Down

0 comments on commit 389bc72

Please sign in to comment.