Skip to content

Commit 23419ad

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 23419ad

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/plugin/test_in_tail.rb

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

2651+
def test_other_user_owned_directory
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+
path = "/var/log/*.log"
2655+
begin
2656+
config = config_element('', '', {
2657+
'tag' => "tail",
2658+
'path' => path,
2659+
'format' => 'none',
2660+
"pos_file" => "#{@tmp_dir}/tail.pos",
2661+
})
2662+
assert_nothing_raised do
2663+
d = create_driver(config, false)
2664+
end
2665+
end
2666+
end
2667+
26512668
def test_shutdown_timeout
26522669
Fluent::FileWrapper.open("#{@tmp_dir}/tail.txt", "wb") do |f|
26532670
# Should be large enough to take too long time to consume

0 commit comments

Comments
 (0)