Skip to content

Commit b2a1722

Browse files
committed
test_in_tail: add test to read root's log file
Signed-off-by: Shizuo Fujita <[email protected]>
1 parent 7ba2227 commit b2a1722

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/plugin/test_in_tail.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,6 +2648,21 @@ def test_no_warn_with_directory_permission
26482648
end
26492649
end
26502650

2651+
def test_other_user_owned_files
2652+
omit "Cannot test with root user" if Process::UID.eid == 0
2653+
omit "NTFS doesn't support UNIX like permissions" if Fluent.windows?
2654+
2655+
config = config_element('', '', {
2656+
'tag' => "tail",
2657+
'path' => "/var/log/*.log",
2658+
'format' => 'none',
2659+
"pos_file" => "#{@tmp_dir}/tail.pos",
2660+
})
2661+
assert_nothing_raised do
2662+
d = create_driver(config, false)
2663+
end
2664+
end
2665+
26512666
def test_shutdown_timeout
26522667
Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt", "wb") do |f|
26532668
# Should be large enough to take too long time to consume

0 commit comments

Comments
 (0)