fluentd 1.13.0-x86-mingw32 → 1.13.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f00f1412978e5ecb62286053a2ce33cb42a17fbde4f42c4d583deb54339b7565
4
- data.tar.gz: a01afb91dd48120e40c86822a83a6cd64dd312cb3809f33cd63c7cffc357c920
3
+ metadata.gz: dfac89a6bc983358dc19675fddc0c6e28182ff1ee3ac07b5d4dde7d25473571f
4
+ data.tar.gz: 693676284c38b07e959db0f571919654feca14bdc3488861d599722ddddd95a0
5
5
  SHA512:
6
- metadata.gz: abcf93241fea449701dad3a7b7e4c488a4ea30f190a7309ef0d36e017959c7f1e6df28e9161f26093930d8b378c2465bc4a16bb53776e4c114559ccca40969dc
7
- data.tar.gz: acec4c758daccd0cace472b5dd9be58a24c25bdf1ada9ace474f4c9123625d3aef62a27d5b1506df22dba0e65af28ac76f0eb1bd6e62e913dcbe498dc62e7734
6
+ metadata.gz: b16a11e6f23e56c87cea1c4f9ae0916f94988ad562b873e83e6ddfa1b54efb1fda304730d236036f1402e5302d3e1498e27d8616a7fa85b23726cbe187c645d8
7
+ data.tar.gz: d0dab564fd15451fbf664818a85cdde1724da2b5677f20ca4d9a4627ee57c5eb8f228bb1b07e954fa3c385978615278ba67e585aa409a8d5ddaaa4884075ca5e
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby-version: ['3.0', '2.7', '2.6', '2.5']
16
+ ruby-version: ['3.0', '2.7', '2.6']
17
17
  os: [ubuntu-latest]
18
18
  experimental: [false]
19
19
  include:
@@ -13,7 +13,7 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby-version: ['2.7', '2.6', '2.5']
16
+ ruby-version: ['2.7', '2.6']
17
17
  os:
18
18
  - windows-latest
19
19
  experimental: [false]
data/.gitlab-ci.yml CHANGED
@@ -13,16 +13,6 @@ stages:
13
13
  - build
14
14
  - tests
15
15
 
16
- 2-5-8:
17
- image: "ruby:2.5.8"
18
- stage: build
19
- extends: .install-template
20
- script:
21
- - bundle install --jobs=3 --retry=3
22
- cache:
23
- key: "$CI_COMMIT_REF_SLUG 2-5-8"
24
- paths:
25
-
26
16
  2-6-6:
27
17
  image: "ruby:2.6.6"
28
18
  stage: build
@@ -64,18 +54,6 @@ rubyhead:
64
54
  paths:
65
55
  - ./*
66
56
 
67
- 2-5-8-test:
68
- image: "ruby:2.5.8"
69
- stage: tests
70
- allow_failure: true
71
- extends: .test-template
72
- script:
73
- - bundle exec rake test
74
- cache:
75
- key: "$CI_COMMIT_REF_SLUG 2-5-8"
76
- paths:
77
- - ./*
78
-
79
57
  2-6-6-test:
80
58
  image: "ruby:2.6.6"
81
59
  stage: tests
data/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+ # v1.13.1
2
+
3
+ ## Release v1.13.1 - 2021/06/25
4
+
5
+ ### Bug fix
6
+
7
+ * out_forward: Fixed a race condition on handshake
8
+ It's caused by using a same unpacker from multiple threads.
9
+ https://github.com/fluent/fluentd/pull/3405
10
+ https://github.com/fluent/fluentd/pull/3406
11
+ * in_tail: Fixed to remove too much verbose debugging logs
12
+ It was unexpectedly introduced by #3185 log throttling feature.
13
+ https://github.com/fluent/fluentd/pull/3418
14
+ * Fixed not to echo back the provides path as is on a 404 error
15
+ There was a potential cross-site scripting vector even though
16
+ it is quite difficult to exploit.
17
+ https://github.com/fluent/fluentd/pull/3427
18
+
19
+ ### Misc
20
+
21
+ * Pretty print for Fluent::Config::Section has been supported
22
+ for debugging
23
+ https://github.com/fluent/fluentd/pull/3398
24
+ * CI: Dropped to run CI for Ruby 2.5
25
+ https://github.com/fluent/fluentd/pull/3412
26
+
1
27
  # v1.13
2
28
 
3
29
  ## Release v1.13.0 - 2021/05/29
@@ -50,6 +50,11 @@ module Fluent
50
50
  "<Fluent::Config::Section #{@params.to_json}>"
51
51
  end
52
52
 
53
+ # Used by PP and Pry
54
+ def pretty_print(q)
55
+ q.text(inspect)
56
+ end
57
+
53
58
  def nil?
54
59
  false
55
60
  end
@@ -993,7 +993,6 @@ module Fluent::Plugin
993
993
  @fifo << data
994
994
  @fifo.read_lines(@lines)
995
995
 
996
- @log.debug("reading file: #{@path}")
997
996
  if limit_bytes_per_second_reached? || should_shutdown_now?
998
997
  # Just get out from tailing loop.
999
998
  read_more = false
@@ -565,8 +565,6 @@ module Fluent::Plugin
565
565
  username: server.username || '',
566
566
  )
567
567
 
568
- @unpacker = Fluent::MessagePackFactory.msgpack_unpacker
569
-
570
568
  @resolved_host = nil
571
569
  @resolved_time = 0
572
570
  @resolved_once = false
@@ -613,7 +611,7 @@ module Fluent::Plugin
613
611
  sleep @sender.read_interval
614
612
  next
615
613
  end
616
- @unpacker.feed_each(buf) do |data|
614
+ Fluent::MessagePackFactory.msgpack_unpacker.feed_each(buf) do |data|
617
615
  if @handshake.invoke(sock, ri, data) == :established
618
616
  @log.debug "connection established", host: @host, port: @port
619
617
  end
@@ -13,21 +13,6 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- #
17
- # Fluentd
18
- #
19
- # Licensed under the Apache License, Version 2.0 (the "License");
20
- # you may not use this file except in compliance with the License.
21
- # You may obtain a copy of the License at
22
- #
23
- # http://www.apache.org/licenses/LICENSE-2.0
24
- #
25
- # Unless required by applicable law or agreed to in writing, software
26
- # distributed under the License is distributed on an "AS IS" BASIS,
27
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28
- # See the License for the specific language governing permissions and
29
- # limitations under the License.
30
- #
31
16
 
32
17
  require 'fluent/plugin/base'
33
18
 
@@ -22,7 +22,7 @@ module Fluent
22
22
  class Router
23
23
  class NotFoundApp
24
24
  def self.call(req)
25
- [404, { 'Content-Type' => 'text/plain' }, "404 Not Found: #{req.path}\n"]
25
+ [404, { 'Content-Type' => 'text/plain' }, "404 Not Found\n"]
26
26
  end
27
27
  end
28
28
 
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Fluent
18
18
 
19
- VERSION = '1.13.0'
19
+ VERSION = '1.13.1'
20
20
 
21
21
  end
@@ -18,20 +18,23 @@ class TestFluentCat < ::Test::Unit::TestCase
18
18
  @primary = create_primary
19
19
  metadata = @primary.buffer.new_metadata
20
20
  @chunk = create_chunk(@primary, metadata, @es)
21
+ @port = unused_port
21
22
  end
22
23
 
23
24
  def teardown
24
25
  FileUtils.rm_rf(TMP_DIR)
26
+ @port = nil
25
27
  end
26
28
 
27
29
  TMP_DIR = File.expand_path(File.dirname(__FILE__) + "/../tmp/command/fluent_cat#{ENV['TEST_ENV_NUMBER']}")
28
30
  FLUENT_CAT_COMMAND = File.expand_path(File.dirname(__FILE__) + "/../../bin/fluent-cat")
29
31
 
30
- PORT = unused_port
31
- CONFIG = %[
32
- port #{PORT}
33
- bind 127.0.0.1
34
- ]
32
+ def config
33
+ %[
34
+ port #{@port}
35
+ bind 127.0.0.1
36
+ ]
37
+ end
35
38
 
36
39
  SECONDARY_CONFIG = %[
37
40
  directory #{TMP_DIR}
@@ -41,7 +44,7 @@ class TestFluentCat < ::Test::Unit::TestCase
41
44
  def write(chunk); end
42
45
  end
43
46
 
44
- def create_driver(conf=CONFIG)
47
+ def create_driver(conf=config)
45
48
  Fluent::Test::Driver::Input.new(Fluent::Plugin::ForwardInput).configure(conf)
46
49
  end
47
50
 
@@ -66,7 +69,7 @@ class TestFluentCat < ::Test::Unit::TestCase
66
69
  def test_cat_json
67
70
  d = create_driver
68
71
  d.run(expect_records: 1) do
69
- Open3.pipeline_w("ruby #{FLUENT_CAT_COMMAND} --port #{PORT} json") do |stdin|
72
+ Open3.pipeline_w("ruby #{FLUENT_CAT_COMMAND} --port #{@port} json") do |stdin|
70
73
  stdin.puts('{"key":"value"}')
71
74
  stdin.close
72
75
  end
@@ -83,7 +86,7 @@ class TestFluentCat < ::Test::Unit::TestCase
83
86
  path = d.instance.write(@chunk)
84
87
  d = create_driver
85
88
  d.run(expect_records: 1) do
86
- Open3.pipeline_w("ruby #{FLUENT_CAT_COMMAND} --port #{PORT} --format msgpack secondary") do |stdin|
89
+ Open3.pipeline_w("ruby #{FLUENT_CAT_COMMAND} --port #{@port} --format msgpack secondary") do |stdin|
87
90
  stdin.write(File.read(path))
88
91
  stdin.close
89
92
  end
@@ -1,5 +1,6 @@
1
1
  require_relative '../helper'
2
2
  require 'fluent/config/section'
3
+ require 'pp'
3
4
 
4
5
  module Fluent::Config
5
6
  class TestSection < ::Test::Unit::TestCase
@@ -176,6 +177,14 @@ module Fluent::Config
176
177
  s1 = Fluent::Config::Section.new(h1)
177
178
  assert_equal(expected, s1.respond_to?(method))
178
179
  end
180
+
181
+ test '#pretty_print' do
182
+ q = PP.new
183
+ h1 = {name: "s1", klass: "A"}
184
+ s1 = Fluent::Config::Section.new(h1)
185
+ s1.pretty_print(q)
186
+ assert_equal s1.inspect, q.output
187
+ end
179
188
  end
180
189
  end
181
190
  end
@@ -18,52 +18,55 @@ class ForwardInputTest < Test::Unit::TestCase
18
18
  Fluent::Test.setup
19
19
  @responses = [] # for testing responses after sending data
20
20
  @d = nil
21
+ @port = unused_port
21
22
  end
22
23
 
23
24
  def teardown
24
25
  @d.instance_shutdown if @d
26
+ @port = nil
25
27
  end
26
28
 
27
- PORT = unused_port
28
-
29
29
  SHARED_KEY = 'foobar1'
30
30
  USER_NAME = 'tagomoris'
31
31
  USER_PASSWORD = 'fluentd'
32
32
 
33
- CONFIG = %[
34
- port #{PORT}
35
- bind 127.0.0.1
36
- ]
33
+ def base_config
34
+ %[
35
+ port #{@port}
36
+ bind 127.0.0.1
37
+ ]
38
+ end
37
39
  LOCALHOST_HOSTNAME_GETTER = ->(){sock = UDPSocket.new(::Socket::AF_INET); sock.do_not_reverse_lookup = false; sock.connect("127.0.0.1", 2048); sock.peeraddr[2] }
38
40
  LOCALHOST_HOSTNAME = LOCALHOST_HOSTNAME_GETTER.call
39
41
  DUMMY_SOCK = Struct.new(:remote_host, :remote_addr, :remote_port).new(LOCALHOST_HOSTNAME, "127.0.0.1", 0)
40
- CONFIG_AUTH = %[
41
- port #{PORT}
42
- bind 127.0.0.1
43
- <security>
44
- self_hostname localhost
45
- shared_key foobar1
46
- user_auth true
47
- <user>
48
- username #{USER_NAME}
49
- password #{USER_PASSWORD}
50
- </user>
51
- <client>
52
- network 127.0.0.0/8
53
- shared_key #{SHARED_KEY}
54
- users ["#{USER_NAME}"]
55
- </client>
56
- </security>
57
- ]
58
-
59
- def create_driver(conf=CONFIG)
42
+
43
+ def config_auth
44
+ base_config + %[
45
+ <security>
46
+ self_hostname localhost
47
+ shared_key foobar1
48
+ user_auth true
49
+ <user>
50
+ username #{USER_NAME}
51
+ password #{USER_PASSWORD}
52
+ </user>
53
+ <client>
54
+ network 127.0.0.0/8
55
+ shared_key #{SHARED_KEY}
56
+ users ["#{USER_NAME}"]
57
+ </client>
58
+ </security>
59
+ ]
60
+ end
61
+
62
+ def create_driver(conf=base_config)
60
63
  Fluent::Test::Driver::Input.new(Fluent::Plugin::ForwardInput).configure(conf)
61
64
  end
62
65
 
63
66
  sub_test_case '#configure' do
64
67
  test 'simple' do
65
68
  @d = d = create_driver
66
- assert_equal PORT, d.instance.port
69
+ assert_equal @port, d.instance.port
67
70
  assert_equal '127.0.0.1', d.instance.bind
68
71
  assert_equal 0, d.instance.linger_timeout
69
72
  assert_equal 0.5, d.instance.blocking_timeout
@@ -71,8 +74,8 @@ class ForwardInputTest < Test::Unit::TestCase
71
74
  end
72
75
 
73
76
  test 'auth' do
74
- @d = d = create_driver(CONFIG_AUTH)
75
- assert_equal PORT, d.instance.port
77
+ @d = d = create_driver(config_auth)
78
+ assert_equal @port, d.instance.port
76
79
  assert_equal '127.0.0.1', d.instance.bind
77
80
  assert_equal 0, d.instance.linger_timeout
78
81
  assert !d.instance.backlog
@@ -86,17 +89,17 @@ class ForwardInputTest < Test::Unit::TestCase
86
89
  add_tag_prefix: "add_tag_prefix")
87
90
  test 'tag parameters' do |data|
88
91
  assert_raise(Fluent::ConfigError.new("'#{data}' parameter must not be empty")) {
89
- create_driver(CONFIG + "#{data} ''")
92
+ create_driver(base_config + "#{data} ''")
90
93
  }
91
94
  end
92
95
 
93
96
  test 'send_keepalive_packet is disabled by default' do
94
- @d = d = create_driver(CONFIG_AUTH)
97
+ @d = d = create_driver(config_auth)
95
98
  assert_false d.instance.send_keepalive_packet
96
99
  end
97
100
 
98
101
  test 'send_keepalive_packet can be enabled' do
99
- @d = d = create_driver(CONFIG_AUTH + %[
102
+ @d = d = create_driver(config_auth + %[
100
103
  send_keepalive_packet true
101
104
  ])
102
105
  assert_true d.instance.send_keepalive_packet
@@ -104,7 +107,7 @@ class ForwardInputTest < Test::Unit::TestCase
104
107
 
105
108
  test 'both send_keepalive_packet and deny_keepalive cannot be enabled' do
106
109
  assert_raise(Fluent::ConfigError.new("both 'send_keepalive_packet' and 'deny_keepalive' cannot be set to true")) do
107
- create_driver(CONFIG_AUTH + %[
110
+ create_driver(config_auth + %[
108
111
  send_keepalive_packet true
109
112
  deny_keepalive true
110
113
  ])
@@ -173,7 +176,7 @@ class ForwardInputTest < Test::Unit::TestCase
173
176
  end
174
177
 
175
178
  test 'skip_invalid_event' do
176
- @d = d = create_driver(CONFIG + "skip_invalid_event true")
179
+ @d = d = create_driver(base_config + "skip_invalid_event true")
177
180
 
178
181
  time = event_time("2011-01-02 13:14:15 UTC")
179
182
 
@@ -243,20 +246,18 @@ class ForwardInputTest < Test::Unit::TestCase
243
246
 
244
247
  sub_test_case 'forward' do
245
248
  data(tcp: {
246
- config: CONFIG,
247
249
  options: {
248
250
  auth: false
249
251
  }
250
252
  },
251
253
  auth: {
252
- config: CONFIG_AUTH,
253
254
  options: {
254
255
  auth: true
255
256
  }
256
257
  })
257
258
  test 'plain' do |data|
258
- config = data[:config]
259
259
  options = data[:options]
260
+ config = options[:auth] ? config_auth : base_config
260
261
  @d = d = create_driver(config)
261
262
 
262
263
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -285,7 +286,7 @@ class ForwardInputTest < Test::Unit::TestCase
285
286
  result: "new_prefix.tag1"
286
287
  })
287
288
  test 'tag parameters' do |data|
288
- @d = create_driver(CONFIG + data[:param])
289
+ @d = create_driver(base_config + data[:param])
289
290
  time = event_time("2011-01-02 13:14:15 UTC")
290
291
  options = {auth: false}
291
292
 
@@ -305,20 +306,18 @@ class ForwardInputTest < Test::Unit::TestCase
305
306
  end
306
307
 
307
308
  data(tcp: {
308
- config: CONFIG,
309
309
  options: {
310
310
  auth: false
311
311
  }
312
312
  },
313
313
  auth: {
314
- config: CONFIG_AUTH,
315
314
  options: {
316
315
  auth: true
317
316
  }
318
317
  })
319
318
  test 'time_as_integer' do |data|
320
- config = data[:config]
321
319
  options = data[:options]
320
+ config = options[:auth] ? config_auth : base_config
322
321
  @d = d = create_driver(config)
323
322
 
324
323
  time_i = event_time("2011-01-02 13:14:15 UTC")
@@ -340,20 +339,18 @@ class ForwardInputTest < Test::Unit::TestCase
340
339
  end
341
340
 
342
341
  data(tcp: {
343
- config: CONFIG,
344
342
  options: {
345
343
  auth: false
346
344
  }
347
345
  },
348
346
  auth: {
349
- config: CONFIG_AUTH,
350
347
  options: {
351
348
  auth: true
352
349
  }
353
350
  })
354
351
  test 'skip_invalid_event' do |data|
355
- config = data[:config]
356
352
  options = data[:options]
353
+ config = options[:auth] ? config_auth : base_config
357
354
  @d = d = create_driver(config + "skip_invalid_event true")
358
355
 
359
356
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -380,20 +377,18 @@ class ForwardInputTest < Test::Unit::TestCase
380
377
 
381
378
  sub_test_case 'packed forward' do
382
379
  data(tcp: {
383
- config: CONFIG,
384
380
  options: {
385
381
  auth: false
386
382
  }
387
383
  },
388
384
  auth: {
389
- config: CONFIG_AUTH,
390
385
  options: {
391
386
  auth: true
392
387
  }
393
388
  })
394
389
  test 'plain' do |data|
395
- config = data[:config]
396
390
  options = data[:options]
391
+ config = options[:auth] ? config_auth : base_config
397
392
  @d = d = create_driver(config)
398
393
 
399
394
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -422,7 +417,7 @@ class ForwardInputTest < Test::Unit::TestCase
422
417
  result: "new_prefix.tag1"
423
418
  })
424
419
  test 'tag parameters' do |data|
425
- @d = create_driver(CONFIG + data[:param])
420
+ @d = create_driver(base_config + data[:param])
426
421
  time = event_time("2011-01-02 13:14:15 UTC")
427
422
  options = {auth: false}
428
423
 
@@ -442,20 +437,18 @@ class ForwardInputTest < Test::Unit::TestCase
442
437
  end
443
438
 
444
439
  data(tcp: {
445
- config: CONFIG,
446
440
  options: {
447
441
  auth: false
448
442
  }
449
443
  },
450
444
  auth: {
451
- config: CONFIG_AUTH,
452
445
  options: {
453
446
  auth: true
454
447
  }
455
448
  })
456
449
  test 'time_as_integer' do |data|
457
- config = data[:config]
458
450
  options = data[:options]
451
+ config = options[:auth] ? config_auth : base_config
459
452
  @d = d = create_driver(config)
460
453
 
461
454
  time_i = event_time("2011-01-02 13:14:15 UTC").to_i
@@ -476,20 +469,18 @@ class ForwardInputTest < Test::Unit::TestCase
476
469
  end
477
470
 
478
471
  data(tcp: {
479
- config: CONFIG,
480
472
  options: {
481
473
  auth: false
482
474
  }
483
475
  },
484
476
  auth: {
485
- config: CONFIG_AUTH,
486
477
  options: {
487
478
  auth: true
488
479
  }
489
480
  })
490
481
  test 'skip_invalid_event' do |data|
491
- config = data[:config]
492
482
  options = data[:options]
483
+ config = options[:auth] ? config_auth : base_config
493
484
  @d = d = create_driver(config + "skip_invalid_event true")
494
485
 
495
486
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -577,7 +568,7 @@ class ForwardInputTest < Test::Unit::TestCase
577
568
 
578
569
  sub_test_case 'warning' do
579
570
  test 'send_large_chunk_warning' do
580
- @d = d = create_driver(CONFIG + %[
571
+ @d = d = create_driver(base_config + %[
581
572
  chunk_size_warn_limit 16M
582
573
  chunk_size_limit 32M
583
574
  ])
@@ -613,7 +604,7 @@ class ForwardInputTest < Test::Unit::TestCase
613
604
  end
614
605
 
615
606
  test 'send_large_chunk_only_warning' do
616
- @d = d = create_driver(CONFIG + %[
607
+ @d = d = create_driver(base_config + %[
617
608
  chunk_size_warn_limit 16M
618
609
  ])
619
610
  time = event_time("2014-04-25 13:14:15 UTC")
@@ -639,7 +630,7 @@ class ForwardInputTest < Test::Unit::TestCase
639
630
  end
640
631
 
641
632
  test 'send_large_chunk_limit' do
642
- @d = d = create_driver(CONFIG + %[
633
+ @d = d = create_driver(base_config + %[
643
634
  chunk_size_warn_limit 16M
644
635
  chunk_size_limit 32M
645
636
  ])
@@ -697,20 +688,18 @@ class ForwardInputTest < Test::Unit::TestCase
697
688
 
698
689
  sub_test_case 'respond to required ack' do
699
690
  data(tcp: {
700
- config: CONFIG,
701
691
  options: {
702
692
  auth: false
703
693
  }
704
694
  },
705
695
  auth: {
706
- config: CONFIG_AUTH,
707
696
  options: {
708
697
  auth: true
709
698
  }
710
699
  })
711
700
  test 'message' do |data|
712
- config = data[:config]
713
701
  options = data[:options]
702
+ config = options[:auth] ? config_auth : base_config
714
703
  @d = d = create_driver(config)
715
704
 
716
705
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -736,20 +725,18 @@ class ForwardInputTest < Test::Unit::TestCase
736
725
 
737
726
  # FIX: response is not pushed into @responses because IO.select has been blocked until InputForward shutdowns
738
727
  data(tcp: {
739
- config: CONFIG,
740
728
  options: {
741
729
  auth: false
742
730
  }
743
731
  },
744
732
  auth: {
745
- config: CONFIG_AUTH,
746
733
  options: {
747
734
  auth: true
748
735
  }
749
736
  })
750
737
  test 'forward' do |data|
751
- config = data[:config]
752
738
  options = data[:options]
739
+ config = options[:auth] ? config_auth : base_config
753
740
  @d = d = create_driver(config)
754
741
 
755
742
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -776,20 +763,18 @@ class ForwardInputTest < Test::Unit::TestCase
776
763
  end
777
764
 
778
765
  data(tcp: {
779
- config: CONFIG,
780
766
  options: {
781
767
  auth: false
782
768
  }
783
769
  },
784
770
  auth: {
785
- config: CONFIG_AUTH,
786
771
  options: {
787
772
  auth: true
788
773
  }
789
774
  })
790
775
  test 'packed_forward' do |data|
791
- config = data[:config]
792
776
  options = data[:options]
777
+ config = options[:auth] ? config_auth : base_config
793
778
  @d = d = create_driver(config)
794
779
 
795
780
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -817,22 +802,20 @@ class ForwardInputTest < Test::Unit::TestCase
817
802
 
818
803
  data(
819
804
  tcp: {
820
- config: CONFIG,
821
805
  options: {
822
806
  auth: false
823
807
  }
824
808
  },
825
809
  ### Auth is not supported with json
826
810
  # auth: {
827
- # config: CONFIG_AUTH,
828
811
  # options: {
829
812
  # auth: true
830
813
  # }
831
814
  # },
832
815
  )
833
816
  test 'message_json' do |data|
834
- config = data[:config]
835
817
  options = data[:options]
818
+ config = options[:auth] ? config_auth : base_config
836
819
  @d = d = create_driver(config)
837
820
 
838
821
  time_i = event_time("2011-01-02 13:14:15 UTC")
@@ -859,20 +842,18 @@ class ForwardInputTest < Test::Unit::TestCase
859
842
 
860
843
  sub_test_case 'not respond without required ack' do
861
844
  data(tcp: {
862
- config: CONFIG,
863
845
  options: {
864
846
  auth: false
865
847
  }
866
848
  },
867
849
  auth: {
868
- config: CONFIG_AUTH,
869
850
  options: {
870
851
  auth: true
871
852
  }
872
853
  })
873
854
  test 'message' do |data|
874
- config = data[:config]
875
855
  options = data[:options]
856
+ config = options[:auth] ? config_auth : base_config
876
857
  @d = d = create_driver(config)
877
858
 
878
859
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -893,20 +874,18 @@ class ForwardInputTest < Test::Unit::TestCase
893
874
  end
894
875
 
895
876
  data(tcp: {
896
- config: CONFIG,
897
877
  options: {
898
878
  auth: false
899
879
  }
900
880
  },
901
881
  auth: {
902
- config: CONFIG_AUTH,
903
882
  options: {
904
883
  auth: true
905
884
  }
906
885
  })
907
886
  test 'forward' do |data|
908
- config = data[:config]
909
887
  options = data[:options]
888
+ config = options[:auth] ? config_auth : base_config
910
889
  @d = d = create_driver(config)
911
890
 
912
891
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -929,20 +908,18 @@ class ForwardInputTest < Test::Unit::TestCase
929
908
  end
930
909
 
931
910
  data(tcp: {
932
- config: CONFIG,
933
911
  options: {
934
912
  auth: false
935
913
  }
936
914
  },
937
915
  auth: {
938
- config: CONFIG_AUTH,
939
916
  options: {
940
917
  auth: true
941
918
  }
942
919
  })
943
920
  test 'packed_forward' do |data|
944
- config = data[:config]
945
921
  options = data[:options]
922
+ config = options[:auth] ? config_auth : base_config
946
923
  @d = d = create_driver(config)
947
924
 
948
925
  time = event_time("2011-01-02 13:14:15 UTC")
@@ -966,22 +943,21 @@ class ForwardInputTest < Test::Unit::TestCase
966
943
 
967
944
  data(
968
945
  tcp: {
969
- config: CONFIG,
970
946
  options: {
971
947
  auth: false
972
948
  }
973
949
  },
974
950
  ### Auth is not supported with json
975
951
  # auth: {
976
- # config: CONFIG_AUTH,
952
+ # config: config_auth,
977
953
  # options: {
978
954
  # auth: true
979
955
  # }
980
956
  # },
981
957
  )
982
958
  test 'message_json' do |data|
983
- config = data[:config]
984
959
  options = data[:options]
960
+ config = options[:auth] ? config_auth : base_config
985
961
  @d = d = create_driver(config)
986
962
 
987
963
  time_i = event_time("2011-01-02 13:14:15 UTC").to_i
@@ -1096,7 +1072,7 @@ class ForwardInputTest < Test::Unit::TestCase
1096
1072
  end
1097
1073
 
1098
1074
  def connect
1099
- TCPSocket.new('127.0.0.1', PORT)
1075
+ TCPSocket.new('127.0.0.1', @port)
1100
1076
  end
1101
1077
 
1102
1078
  # Data ordering is not assured:
@@ -1165,7 +1141,7 @@ class ForwardInputTest < Test::Unit::TestCase
1165
1141
  end
1166
1142
 
1167
1143
  def execute_test_with_source_hostname_key(*keys, &block)
1168
- conf = CONFIG.dup
1144
+ conf = base_config.dup
1169
1145
  if keys.include?(:hostname)
1170
1146
  conf << <<EOL
1171
1147
  source_hostname_key source_hostname