require_relative '../helper' require 'fluent/test' require 'net/http' class ExecInputTest < Test::Unit::TestCase def setup Fluent::Test.setup @test_time = Time.parse("2011-01-02 13:14:15").to_i @script = File.expand_path(File.join(File.dirname(__FILE__), '..', 'scripts', 'exec_script.rb')) end def create_driver(conf = tsv_config) Fluent::Test::InputTestDriver.new(Fluent::ExecInput).configure(conf) end def tsv_config %[ command ruby #{@script} "2011-01-02 13:14:15" 0 keys time,tag,k1 time_key time tag_key tag time_format %Y-%m-%d %H:%M:%S run_interval 1s ] end def json_config %[ command ruby #{@script} #{@test_time} 1 format json tag_key tag time_key time run_interval 1s ] end def msgpack_config %[ command ruby #{@script} #{@test_time} 2 format msgpack tag_key tagger time_key datetime run_interval 1s ] end def regexp_config %[ command ruby #{@script} "2011-01-02 13:14:15" 3 format /(?