mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Added a test for the SINCEDB_DIR functionality
Setting SINCEDB_DIR in your environment allows you to override the target directory for sincedb files. The added test verifies that this functionality works properly
This commit is contained in:
parent
be7132603d
commit
815f5b294a
1 changed files with 13 additions and 0 deletions
|
@ -125,5 +125,18 @@ describe LogStash::Inputs::File do
|
|||
flunk "An absolute path containing a wildcard should be valid"
|
||||
end
|
||||
end
|
||||
|
||||
test "file input should use SINCEDB_DIR environment variable as default sincedb location if it is set" do
|
||||
logfile = Tempfile.new("logstash")
|
||||
the_destination = "/tmp/sincedb"
|
||||
ENV['SINCEDB_DIR'] = the_destination
|
||||
begin
|
||||
@input = LogStash::Inputs::File.new("type" => ["testing"], "path" => [logfile.path])
|
||||
@input.register
|
||||
assert_equal File.dirname(@input.instance_variable_get(:@sincedb_dir)) the_destination
|
||||
ensure
|
||||
logfile.close
|
||||
logfile.unlink
|
||||
end
|
||||
|
||||
end # testing for LogStash::Inputs::File
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue