logstash-output-scalyr 0.1.6 → 0.1.11.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/Gemfile +6 -0
- data/README.md +57 -4
- data/lib/logstash/outputs/scalyr.rb +284 -107
- data/lib/scalyr/common/client.rb +117 -43
- data/lib/scalyr/constants.rb +2 -0
- data/logstash-output-scalyr.gemspec +2 -1
- data/spec/benchmarks/flattening_and_serialization.rb +125 -0
- data/spec/benchmarks/metrics_overhead.rb +48 -0
- data/spec/logstash/outputs/scalyr_integration_spec.rb +188 -0
- data/spec/logstash/outputs/scalyr_spec.rb +141 -71
- data/vendor/bundle/jruby/2.5.0/cache/addressable-2.7.0.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/connection_pool-2.2.5.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/crack-0.4.5.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/hashdiff-1.0.1.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/net-http-persistent-4.0.1.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/public_suffix-4.0.6.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/quantile-0.2.1.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/rexml-3.2.5.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/webmock-3.13.0.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/CHANGELOG.md +235 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Gemfile +32 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/LICENSE.txt +202 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/README.md +121 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/Rakefile +34 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/data/unicode.data +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable.rb +4 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna.rb +27 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/native.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/idna/pure.rb +676 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/template.rb +1045 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/uri.rb +2529 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/lib/addressable/version.rb +32 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/idna_spec.rb +300 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/net_http_compat_spec.rb +30 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/rack_mount_compat_spec.rb +106 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/security_spec.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/template_spec.rb +1451 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/addressable/uri_spec.rb +6603 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/spec/spec_helper.rb +24 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/clobber.rake +4 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/gem.rake +93 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/git.rake +47 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/metrics.rake +24 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/rspec.rake +23 -0
- data/vendor/bundle/jruby/2.5.0/gems/addressable-2.7.0/tasks/yard.rake +29 -0
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/Changes.md +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/Gemfile +0 -2
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/LICENSE +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/README.md +29 -5
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/Rakefile +0 -1
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/connection_pool.gemspec +1 -0
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/lib/connection_pool.rb +16 -0
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/lib/connection_pool/timed_stack.rb +9 -5
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/lib/connection_pool/version.rb +1 -1
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/lib/connection_pool/wrapper.rb +17 -3
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/test/helper.rb +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/test/test_connection_pool.rb +16 -2
- data/vendor/bundle/jruby/2.5.0/gems/{connection_pool-2.2.3 → connection_pool-2.2.5}/test/test_connection_pool_timed_stack.rb +10 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack.rb +7 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/json.rb +98 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/util.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/version.rb +3 -0
- data/vendor/bundle/jruby/2.5.0/gems/crack-0.4.5/lib/crack/xml.rb +238 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Gemfile +8 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/LICENSE +19 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/README.md +276 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/Rakefile +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/changelog.md +100 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/hashdiff.gemspec +39 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff.rb +10 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/compare_hashes.rb +69 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/diff.rb +177 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs.rb +66 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/linear_compare_array.rb +159 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/patch.rb +88 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/util.rb +155 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/lib/hashdiff/version.rb +5 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/best_diff_spec.rb +75 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_array_spec.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/diff_spec.rb +360 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/lcs_spec.rb +76 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/linear_compare_array_spec.rb +50 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/patch_spec.rb +185 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/readme_spec.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/hashdiff/util_spec.rb +116 -0
- data/vendor/bundle/jruby/2.5.0/gems/hashdiff-1.0.1/spec/spec_helper.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/Gemfile +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/History.txt +6 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/Manifest.txt +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/README.rdoc +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/Rakefile +1 -1
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/lib/net/http/persistent.rb +1 -1
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/lib/net/http/persistent/connection.rb +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/lib/net/http/persistent/pool.rb +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/lib/net/http/persistent/timed_stack_multi.rb +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/test/test_net_http_persistent.rb +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/{net-http-persistent-4.0.0 → net-http-persistent-4.0.1}/test/test_net_http_persistent_timed_stack_multi.rb +0 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/2.0-Upgrade.md +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/CHANGELOG.md +406 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Gemfile +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/LICENSE.txt +22 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/README.md +207 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/Rakefile +51 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/SECURITY.md +104 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/bin/console +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/codecov.yml +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/data/list.txt +13380 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix.rb +179 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/domain.rb +235 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/errors.rb +41 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/list.rb +247 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/rule.rb +350 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/lib/public_suffix/version.rb +13 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/public_suffix.gemspec +29 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/acceptance_test.rb +131 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find.rb +66 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_find_all.rb +102 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_names.rb +91 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select.rb +26 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_select_incremental.rb +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/benchmarks/bm_valid.rb +101 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/domain_profiler.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/find_profiler_jp.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/initialization_profiler.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/list_profsize.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/profilers/object_binsize.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/psl_test.rb +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/test_helper.rb +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/tests.txt +98 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/domain_test.rb +106 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/errors_test.rb +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/list_test.rb +241 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/public_suffix_test.rb +188 -0
- data/vendor/bundle/jruby/2.5.0/gems/public_suffix-4.0.6/test/unit/rule_test.rb +222 -0
- data/vendor/bundle/jruby/2.5.0/gems/quantile-0.2.1/LICENSE +191 -0
- data/vendor/bundle/jruby/2.5.0/gems/quantile-0.2.1/README.md +55 -0
- data/vendor/bundle/jruby/2.5.0/gems/quantile-0.2.1/lib/quantile.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/quantile-0.2.1/lib/quantile/estimator.rb +186 -0
- data/vendor/bundle/jruby/2.5.0/gems/quantile-0.2.1/lib/quantile/quantile.rb +66 -0
- data/vendor/bundle/jruby/2.5.0/gems/quantile-0.2.1/lib/quantile/version.rb +16 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/LICENSE.txt +22 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/NEWS.md +178 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/README.md +48 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/context.rdoc +143 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/child.rdoc +87 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/document.rdoc +276 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/element.rdoc +602 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/node.rdoc +97 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml.rb +3 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +63 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +205 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +68 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/child.rb +97 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/comment.rb +80 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +311 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/document.rb +451 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +47 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +40 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/element.rb +2599 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +51 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/entity.rb +171 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +116 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +142 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +58 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/functions.rb +447 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +79 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/light/node.rb +188 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/node.rb +76 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/output.rb +30 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parent.rb +166 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +694 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +197 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +273 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +101 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +689 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +266 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +37 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +98 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/security.rb +28 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/source.rb +298 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +93 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/text.rb +424 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +539 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +144 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +10 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +130 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +85 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +81 -0
- data/vendor/bundle/jruby/2.5.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +974 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/CHANGELOG.md +1894 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Gemfile +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/LICENSE +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/README.md +1176 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/Rakefile +38 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock.rb +59 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/api.rb +109 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/assertion_failure.rb +11 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/callback_registry.rb +35 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/config.rb +18 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/cucumber.rb +10 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/deprecation.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/errors.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +216 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/curb_adapter.rb +351 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +231 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/excon_adapter.rb +165 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter.rb +7 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +19 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/request.rb +16 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/response.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/streamer.rb +29 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb/webmock.rb +68 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/http_rb_adapter.rb +37 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/httpclient_adapter.rb +259 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/manticore_adapter.rb +145 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http.rb +385 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/net_http_response.rb +34 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/patron_adapter.rb +130 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +174 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/any_arg_matcher.rb +13 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_argument_matcher.rb +21 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_excluding_matcher.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/matchers/hash_including_matcher.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/minitest.rb +41 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rack_response.rb +69 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_body_diff.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_execution_verifier.rb +77 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_pattern.rb +405 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_registry.rb +35 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature.rb +54 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_signature_snippet.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/request_stub.rb +100 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/response.rb +159 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/responses_sequence.rb +40 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec.rb +42 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers.rb +27 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/request_pattern_matcher.rb +78 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/rspec/matchers/webmock_matcher.rb +67 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_registry.rb +82 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/stub_request_snippet.rb +38 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/test_unit.rb +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_counter.rb +39 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_keys_stringifier.rb +25 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/hash_validator.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/headers.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/json.rb +67 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/query_mapper.rb +281 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/uri.rb +111 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/values_stringifier.rb +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/util/version_checker.rb +111 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/version.rb +3 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/lib/webmock/webmock.rb +163 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_helper.rb +34 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/test_webmock.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/minitest/webmock_spec.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec.rb +375 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/async_http_client/async_http_client_spec_helper.rb +73 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec.rb +499 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/curb/curb_spec_helper.rb +147 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec.rb +462 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +77 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec.rb +77 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/excon/excon_spec_helper.rb +52 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec.rb +93 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/http_rb/http_rb_spec_helper.rb +54 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec.rb +217 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/httpclient/httpclient_spec_helper.rb +57 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec.rb +107 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/manticore/manticore_spec_helper.rb +35 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_shared.rb +153 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec.rb +369 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/net_http_spec_helper.rb +64 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/net_http/real_net_http_spec.rb +20 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec.rb +125 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/patron/patron_spec_helper.rb +54 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/allowing_and_disabling_net_connect.rb +313 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/callbacks.rb +148 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/complex_cross_concern_behaviors.rb +36 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/enabling_and_disabling_webmock.rb +95 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/precedence_of_stubs.rb +15 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/request_expectations.rb +930 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/returning_declared_responses.rb +409 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/shared/stubbing_requests.rb +678 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec.rb +135 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/typhoeus/typhoeus_hydra_spec_helper.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/acceptance/webmock_shared.rb +41 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/fixtures/test.txt +1 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/quality_spec.rb +84 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/spec_helper.rb +48 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/example_curl_output.txt +22 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/failures.rb +9 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/my_rack_app.rb +53 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/network_connection.rb +19 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/support/webmock_server.rb +70 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/api_spec.rb +175 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/errors_spec.rb +129 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_registry_spec.rb +17 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/http_lib_adapters/http_lib_adapter_spec.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_excluding_matcher_spec.rb +61 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/matchers/hash_including_matcher_spec.rb +87 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/rack_response_spec.rb +112 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_body_diff_spec.rb +90 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_execution_verifier_spec.rb +208 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_pattern_spec.rb +736 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_registry_spec.rb +95 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_snippet_spec.rb +89 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_signature_spec.rb +155 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/request_stub_spec.rb +199 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/response_spec.rb +286 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_registry_spec.rb +103 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/stub_request_snippet_spec.rb +115 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_counter_spec.rb +39 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/hash_keys_stringifier_spec.rb +27 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/headers_spec.rb +28 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/json_spec.rb +33 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/query_mapper_spec.rb +157 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/uri_spec.rb +371 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/util/version_checker_spec.rb +65 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/spec/unit/webmock_spec.rb +60 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/http_request.rb +24 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/shared_test.rb +108 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_helper.rb +23 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/test/test_webmock.rb +12 -0
- data/vendor/bundle/jruby/2.5.0/gems/webmock-3.13.0/webmock.gemspec +54 -0
- data/vendor/bundle/jruby/2.5.0/specifications/addressable-2.7.0.gemspec +39 -0
- data/vendor/bundle/jruby/2.5.0/specifications/{connection_pool-2.2.3.gemspec → connection_pool-2.2.5.gemspec} +4 -3
- data/vendor/bundle/jruby/2.5.0/specifications/crack-0.4.5.gemspec +32 -0
- data/vendor/bundle/jruby/2.5.0/specifications/hashdiff-1.0.1.gemspec +46 -0
- data/vendor/bundle/jruby/2.5.0/specifications/{net-http-persistent-4.0.0.gemspec → net-http-persistent-4.0.1.gemspec} +4 -5
- data/vendor/bundle/jruby/2.5.0/specifications/public_suffix-4.0.6.gemspec +24 -0
- data/vendor/bundle/jruby/2.5.0/specifications/quantile-0.2.1.gemspec +20 -0
- data/vendor/bundle/jruby/2.5.0/specifications/rexml-3.2.5.gemspec +42 -0
- data/vendor/bundle/jruby/2.5.0/specifications/webmock-3.13.0.gemspec +85 -0
- metadata +367 -32
- data/vendor/bundle/jruby/2.5.0/cache/connection_pool-2.2.3.gem +0 -0
- data/vendor/bundle/jruby/2.5.0/cache/net-http-persistent-4.0.0.gem +0 -0
@@ -0,0 +1,188 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "logstash/devutils/rspec/spec_helper"
|
3
|
+
require "logstash/outputs/scalyr"
|
4
|
+
require "logstash/codecs/plain"
|
5
|
+
require "logstash/event"
|
6
|
+
require "json"
|
7
|
+
require 'webmock/rspec'
|
8
|
+
WebMock.allow_net_connect!
|
9
|
+
|
10
|
+
describe LogStash::Outputs::Scalyr do
|
11
|
+
let(:sample_events) {
|
12
|
+
events = []
|
13
|
+
for i in 1..3 do
|
14
|
+
e = LogStash::Event.new
|
15
|
+
e.set('source_host', "my host #{i}")
|
16
|
+
e.set('source_file', "my file #{i}")
|
17
|
+
e.set('seq', i)
|
18
|
+
e.set('nested', {'a'=>1, 'b'=>[3,4,5]})
|
19
|
+
e.set('tags', ['t1', 't2', 't3'])
|
20
|
+
events.push(e)
|
21
|
+
end
|
22
|
+
events
|
23
|
+
}
|
24
|
+
|
25
|
+
describe "#ssl_tests" do
|
26
|
+
context "with default SSL configuration" do
|
27
|
+
it "throws a ServerError due to fake api key" do
|
28
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234'})
|
29
|
+
plugin.register
|
30
|
+
plugin.instance_variable_set(:@running, false)
|
31
|
+
expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
32
|
+
{
|
33
|
+
:batch_num=>1,
|
34
|
+
:code=>401,
|
35
|
+
:message=>"error/client/badParam",
|
36
|
+
:payload_size=>781,
|
37
|
+
:record_count=>3,
|
38
|
+
:total_batches=>1,
|
39
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
40
|
+
:will_retry_in_seconds=>2
|
41
|
+
}
|
42
|
+
)
|
43
|
+
plugin.multi_receive(sample_events)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context "when pointing at a location without any valid certs and not using builtin" do
|
48
|
+
it "throws an SSLError" do
|
49
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
50
|
+
plugin.register
|
51
|
+
plugin.instance_variable_set(:@running, false)
|
52
|
+
expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
53
|
+
{
|
54
|
+
:batch_num=>1,
|
55
|
+
:message=>"Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty",
|
56
|
+
:payload_size=>781,
|
57
|
+
:record_count=>3,
|
58
|
+
:total_batches=>1,
|
59
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
60
|
+
:will_retry_in_seconds=>2
|
61
|
+
}
|
62
|
+
)
|
63
|
+
plugin.multi_receive(sample_events)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context "when system certs are missing and not using builtin" do
|
68
|
+
it "throws an SSLError" do
|
69
|
+
`sudo mv #{OpenSSL::X509::DEFAULT_CERT_FILE} /tmp/system_cert.pem`
|
70
|
+
`sudo mv #{OpenSSL::X509::DEFAULT_CERT_DIR} /tmp/system_certs`
|
71
|
+
|
72
|
+
begin
|
73
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'append_builtin_cert' => false})
|
74
|
+
plugin.register
|
75
|
+
plugin.instance_variable_set(:@running, false)
|
76
|
+
expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
77
|
+
{
|
78
|
+
:batch_num=>1,
|
79
|
+
:message=>"Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty",
|
80
|
+
:payload_size=>781,
|
81
|
+
:record_count=>3,
|
82
|
+
:total_batches=>1,
|
83
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
84
|
+
:will_retry_in_seconds=>2
|
85
|
+
}
|
86
|
+
)
|
87
|
+
plugin.multi_receive(sample_events)
|
88
|
+
end
|
89
|
+
ensure
|
90
|
+
`sudo mv /tmp/system_certs #{OpenSSL::X509::DEFAULT_CERT_DIR}`
|
91
|
+
`sudo mv /tmp/system_cert.pem #{OpenSSL::X509::DEFAULT_CERT_FILE}`
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
context "when server hostname doesn't match the cert" do
|
96
|
+
it "throws an SSLError" do
|
97
|
+
agent_scalyr_com_ip = `dig +short agent.scalyr.com 2> /dev/null | tail -n 1 | tr -d "\n"`
|
98
|
+
if agent_scalyr_com_ip.empty?
|
99
|
+
agent_scalyr_com_ip = `getent hosts agent.scalyr.com \
|
100
|
+
| awk '{ print $1 }' | tail -n 1 | tr -d "\n"`
|
101
|
+
end
|
102
|
+
mock_host = "invalid.mitm.should.fail.test.agent.scalyr.com"
|
103
|
+
etc_hosts_entry = "#{agent_scalyr_com_ip} #{mock_host}"
|
104
|
+
hosts_bkp = `sudo cat /etc/hosts`
|
105
|
+
hosts_bkp = hosts_bkp.chomp
|
106
|
+
# Add mock /etc/hosts entry and config scalyr_server entry
|
107
|
+
`echo "#{etc_hosts_entry}" | sudo tee -a /etc/hosts`
|
108
|
+
|
109
|
+
begin
|
110
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'scalyr_server' => 'https://invalid.mitm.should.fail.test.agent.scalyr.com:443'})
|
111
|
+
plugin.register
|
112
|
+
plugin.instance_variable_set(:@running, false)
|
113
|
+
expect(plugin.instance_variable_get(:@logger)).to receive(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
114
|
+
{
|
115
|
+
:batch_num=>1,
|
116
|
+
:message=>"Host name 'invalid.mitm.should.fail.test.agent.scalyr.com' does not match the certificate subject provided by the peer (CN=*.scalyr.com)",
|
117
|
+
:payload_size=>781,
|
118
|
+
:record_count=>3,
|
119
|
+
:total_batches=>1,
|
120
|
+
:url=>"https://invalid.mitm.should.fail.test.agent.scalyr.com/addEvents",
|
121
|
+
:will_retry_in_seconds=>2
|
122
|
+
}
|
123
|
+
)
|
124
|
+
plugin.multi_receive(sample_events)
|
125
|
+
ensure
|
126
|
+
# Clean up the hosts file
|
127
|
+
`sudo truncate -s 0 /etc/hosts`
|
128
|
+
`echo "#{hosts_bkp}" | sudo tee -a /etc/hosts`
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe "response_handling_tests" do
|
135
|
+
context "when receiving a 503 response" do
|
136
|
+
it "don't throw an error but do log one to debug" do
|
137
|
+
stub_request(:post, "https://agent.scalyr.com/addEvents").
|
138
|
+
to_return(status: 503, body: "stubbed response", headers: {})
|
139
|
+
|
140
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
141
|
+
plugin.register
|
142
|
+
plugin.instance_variable_set(:@running, false)
|
143
|
+
|
144
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:debug)
|
145
|
+
plugin.multi_receive(sample_events)
|
146
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:debug).with("Error uploading to Scalyr (will backoff-retry)",
|
147
|
+
{
|
148
|
+
:batch_num=>1,
|
149
|
+
:code=>503,
|
150
|
+
:message=>"Invalid JSON response from server",
|
151
|
+
:payload_size=>781,
|
152
|
+
:record_count=>3,
|
153
|
+
:total_batches=>1,
|
154
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
155
|
+
:will_retry_in_seconds=>2
|
156
|
+
}
|
157
|
+
)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
context "when receiving a 500 response" do
|
162
|
+
it "don't throw an error but do log one to error" do
|
163
|
+
stub_request(:post, "https://agent.scalyr.com/addEvents").
|
164
|
+
to_return(status: 500, body: "stubbed response", headers: {})
|
165
|
+
|
166
|
+
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
167
|
+
plugin.register
|
168
|
+
plugin.instance_variable_set(:@running, false)
|
169
|
+
|
170
|
+
allow(plugin.instance_variable_get(:@logger)).to receive(:error)
|
171
|
+
plugin.multi_receive(sample_events)
|
172
|
+
expect(plugin.instance_variable_get(:@logger)).to have_received(:error).with("Error uploading to Scalyr (will backoff-retry)",
|
173
|
+
{
|
174
|
+
:batch_num=>1,
|
175
|
+
:code=>500,
|
176
|
+
:message=>"Invalid JSON response from server",
|
177
|
+
:payload_size=>781,
|
178
|
+
:record_count=>3,
|
179
|
+
:total_batches=>1,
|
180
|
+
:url=>"https://agent.scalyr.com/addEvents",
|
181
|
+
:will_retry_in_seconds=>2
|
182
|
+
}
|
183
|
+
)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
end
|
@@ -4,8 +4,37 @@ require "logstash/outputs/scalyr"
|
|
4
4
|
require "logstash/codecs/plain"
|
5
5
|
require "logstash/event"
|
6
6
|
require "json"
|
7
|
+
require "quantile"
|
7
8
|
|
8
9
|
|
10
|
+
class MockClientSession
|
11
|
+
DEFAULT_STATS = {
|
12
|
+
:total_requests_sent => 20,
|
13
|
+
:total_requests_failed => 10,
|
14
|
+
:total_request_bytes_sent => 100,
|
15
|
+
:total_compressed_request_bytes_sent => 50,
|
16
|
+
:total_response_bytes_received => 100,
|
17
|
+
:total_request_latency_secs => 100,
|
18
|
+
:total_serialization_duration_secs => 100.5,
|
19
|
+
:total_compression_duration_secs => 10.20,
|
20
|
+
:compression_type => "deflate",
|
21
|
+
:compression_level => 9,
|
22
|
+
}
|
23
|
+
|
24
|
+
def initialize(stats = DEFAULT_STATS)
|
25
|
+
@stats = stats
|
26
|
+
@sent_events = []
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_stats
|
30
|
+
@stats.clone
|
31
|
+
end
|
32
|
+
|
33
|
+
def post_add_events(body, is_status, body_serialization_duration = 0)
|
34
|
+
@sent_events << { :body => body, :body_serialization_duration => body_serialization_duration }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
9
38
|
|
10
39
|
describe LogStash::Outputs::Scalyr do
|
11
40
|
let(:sample_events) {
|
@@ -24,6 +53,118 @@ describe LogStash::Outputs::Scalyr do
|
|
24
53
|
|
25
54
|
describe "#build_multi_event_request_array" do
|
26
55
|
|
56
|
+
context "test get_stats and send_status" do
|
57
|
+
plugin = LogStash::Outputs::Scalyr.new({
|
58
|
+
'api_write_token' => '1234',
|
59
|
+
'serverhost_field' => 'source_host',
|
60
|
+
'log_constants' => ['tags'],
|
61
|
+
'flatten_nested_values' => true,
|
62
|
+
})
|
63
|
+
|
64
|
+
mock_client_session = MockClientSession.new
|
65
|
+
|
66
|
+
it "returns correct stats on get_stats" do
|
67
|
+
stats = mock_client_session.get_stats
|
68
|
+
expect(stats[:total_requests_sent]).to eq(20)
|
69
|
+
end
|
70
|
+
|
71
|
+
it "it doesnt include flatten metrics if flattening is disabled" do
|
72
|
+
plugin1 = LogStash::Outputs::Scalyr.new({
|
73
|
+
'api_write_token' => '1234',
|
74
|
+
'serverhost_field' => 'source_host',
|
75
|
+
'log_constants' => ['tags'],
|
76
|
+
'flatten_nested_values' => false,
|
77
|
+
})
|
78
|
+
mock_client_session = MockClientSession.new
|
79
|
+
plugin1.instance_variable_set(:@last_status_transmit_time, 100)
|
80
|
+
plugin1.instance_variable_set(:@client_session, mock_client_session)
|
81
|
+
plugin1.instance_variable_set(:@session_id, "some_session_id")
|
82
|
+
plugin1.instance_variable_set(:@plugin_metrics, {
|
83
|
+
:multi_receive_duration_secs => Quantile::Estimator.new,
|
84
|
+
:multi_receive_event_count => Quantile::Estimator.new,
|
85
|
+
:event_attributes_count => Quantile::Estimator.new,
|
86
|
+
:flatten_values_duration_secs => Quantile::Estimator.new,
|
87
|
+
:batches_per_multi_receive => Quantile::Estimator.new
|
88
|
+
})
|
89
|
+
plugin1.instance_variable_get(:@plugin_metrics)[:multi_receive_duration_secs].observe(1)
|
90
|
+
plugin1.instance_variable_set(:@multi_receive_statistics, {:total_multi_receive_secs => 0})
|
91
|
+
|
92
|
+
status_event = plugin1.send_status
|
93
|
+
expect(status_event[:attrs]["message"]).to eq("plugin_status: total_requests_sent=20 total_requests_failed=10 total_request_bytes_sent=100 total_compressed_request_bytes_sent=50 total_response_bytes_received=100 total_request_latency_secs=100 total_serialization_duration_secs=100.5000 total_compression_duration_secs=10.2000 compression_type=deflate compression_level=9 total_multi_receive_secs=0 multi_receive_duration_p50=1 multi_receive_duration_p90=1 multi_receive_duration_p99=1 multi_receive_event_count_p50=0 multi_receive_event_count_p90=0 multi_receive_event_count_p99=0 event_attributes_count_p50=0 event_attributes_count_p90=0 event_attributes_count_p99=0 batches_per_multi_receive_p50=0 batches_per_multi_receive_p90=0 batches_per_multi_receive_p99=0")
|
94
|
+
end
|
95
|
+
|
96
|
+
it "returns and sends correct status event on send_stats on initial and subsequent send" do
|
97
|
+
# 1. Initial send
|
98
|
+
plugin.instance_variable_set(:@last_status_transmit_time, nil)
|
99
|
+
plugin.instance_variable_set(:@client_session, mock_client_session)
|
100
|
+
plugin.instance_variable_set(:@session_id, "some_session_id")
|
101
|
+
status_event = plugin.send_status
|
102
|
+
expect(status_event[:attrs]["message"]).to eq("Started Scalyr LogStash output plugin (%s)." % [PLUGIN_VERSION])
|
103
|
+
|
104
|
+
# 2. Second send
|
105
|
+
plugin.instance_variable_set(:@last_status_transmit_time, 100)
|
106
|
+
plugin.instance_variable_set(:@client_session, mock_client_session)
|
107
|
+
# Setup one quantile calculation to make sure at least one of them calculates as expected
|
108
|
+
plugin.instance_variable_set(:@plugin_metrics, {
|
109
|
+
:multi_receive_duration_secs => Quantile::Estimator.new,
|
110
|
+
:multi_receive_event_count => Quantile::Estimator.new,
|
111
|
+
:event_attributes_count => Quantile::Estimator.new,
|
112
|
+
:flatten_values_duration_secs => Quantile::Estimator.new,
|
113
|
+
:batches_per_multi_receive => Quantile::Estimator.new
|
114
|
+
})
|
115
|
+
|
116
|
+
(1..20).each do |n|
|
117
|
+
plugin.instance_variable_get(:@plugin_metrics)[:multi_receive_duration_secs].observe(n)
|
118
|
+
end
|
119
|
+
|
120
|
+
plugin.instance_variable_set(:@multi_receive_statistics, {:total_multi_receive_secs => 0})
|
121
|
+
status_event = plugin.send_status
|
122
|
+
expect(status_event[:attrs]["message"]).to eq("plugin_status: total_requests_sent=20 total_requests_failed=10 total_request_bytes_sent=100 total_compressed_request_bytes_sent=50 total_response_bytes_received=100 total_request_latency_secs=100 total_serialization_duration_secs=100.5000 total_compression_duration_secs=10.2000 compression_type=deflate compression_level=9 total_multi_receive_secs=0 multi_receive_duration_p50=10 multi_receive_duration_p90=18 multi_receive_duration_p99=19 multi_receive_event_count_p50=0 multi_receive_event_count_p90=0 multi_receive_event_count_p99=0 event_attributes_count_p50=0 event_attributes_count_p90=0 event_attributes_count_p99=0 batches_per_multi_receive_p50=0 batches_per_multi_receive_p90=0 batches_per_multi_receive_p99=0 flatten_values_duration_secs_p50=0 flatten_values_duration_secs_p90=0 flatten_values_duration_secs_p99=0")
|
123
|
+
end
|
124
|
+
|
125
|
+
it "send_stats is called when events list is empty, but otherwise noop" do
|
126
|
+
quantile_estimator = Quantile::Estimator.new
|
127
|
+
plugin.instance_variable_set(:@plugin_metrics, {
|
128
|
+
:multi_receive_duration_secs => Quantile::Estimator.new,
|
129
|
+
:multi_receive_event_count => Quantile::Estimator.new,
|
130
|
+
:event_attributes_count => Quantile::Estimator.new,
|
131
|
+
:flatten_values_duration_secs => Quantile::Estimator.new
|
132
|
+
})
|
133
|
+
plugin.instance_variable_set(:@client_session, mock_client_session)
|
134
|
+
expect(plugin).to receive(:send_status)
|
135
|
+
expect(quantile_estimator).not_to receive(:observe)
|
136
|
+
expect(mock_client_session).not_to receive(:post_add_events)
|
137
|
+
plugin.multi_receive([])
|
138
|
+
end
|
139
|
+
|
140
|
+
# Kind of a weak test but I don't see a decent way to write a stronger one without a live client session
|
141
|
+
it "send_status only sends posts with is_status = true" do
|
142
|
+
# 1. Initial send
|
143
|
+
plugin.instance_variable_set(:@last_status_transmit_time, nil)
|
144
|
+
plugin.instance_variable_set(:@client_session, mock_client_session)
|
145
|
+
plugin.instance_variable_set(:@session_id, "some_session_id")
|
146
|
+
expect(mock_client_session).to receive(:post_add_events).with(anything, true, anything)
|
147
|
+
plugin.send_status
|
148
|
+
|
149
|
+
# 2. Second send
|
150
|
+
plugin.instance_variable_set(:@last_status_transmit_time, 100)
|
151
|
+
plugin.instance_variable_set(:@client_session, mock_client_session)
|
152
|
+
plugin.instance_variable_set(:@plugin_metrics, {
|
153
|
+
:multi_receive_duration_secs => Quantile::Estimator.new,
|
154
|
+
:multi_receive_event_count => Quantile::Estimator.new,
|
155
|
+
:event_attributes_count => Quantile::Estimator.new,
|
156
|
+
:flatten_values_duration_secs => Quantile::Estimator.new,
|
157
|
+
:batches_per_multi_receive => Quantile::Estimator.new
|
158
|
+
})
|
159
|
+
(1..20).each do |n|
|
160
|
+
plugin.instance_variable_get(:@plugin_metrics)[:multi_receive_duration_secs].observe(n)
|
161
|
+
end
|
162
|
+
plugin.instance_variable_set(:@multi_receive_statistics, {:total_multi_receive_secs => 0})
|
163
|
+
expect(mock_client_session).to receive(:post_add_events).with(anything, true, anything)
|
164
|
+
plugin.send_status
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
27
168
|
context "when a field is configured as a log attribute" do
|
28
169
|
it "creates logfile from serverHost" do
|
29
170
|
plugin = LogStash::Outputs::Scalyr.new({
|
@@ -36,7 +177,6 @@ describe LogStash::Outputs::Scalyr do
|
|
36
177
|
result = plugin.build_multi_event_request_array(sample_events)
|
37
178
|
body = JSON.parse(result[0][:body])
|
38
179
|
expect(body['events'].size).to eq(3)
|
39
|
-
attrs2 = body['events'][2]['attrs']
|
40
180
|
logattrs2 = body['logs'][2]['attrs']
|
41
181
|
expect(logattrs2.fetch('serverHost', nil)).to eq('my host 3')
|
42
182
|
expect(logattrs2.fetch('logfile', nil)).to eq('/logstash/my host 3')
|
@@ -67,7 +207,6 @@ describe LogStash::Outputs::Scalyr do
|
|
67
207
|
result = plugin.build_multi_event_request_array(sample_events)
|
68
208
|
body = JSON.parse(result[0][:body])
|
69
209
|
expect(body['events'].size).to eq(3)
|
70
|
-
attrs2 = body['events'][2]['attrs']
|
71
210
|
logattrs2 = body['logs'][2]['attrs']
|
72
211
|
expect(logattrs2.fetch('serverHost', nil)).to eq('my host 3')
|
73
212
|
expect(logattrs2.fetch('logfile', nil)).to eq('/logstash/my host 3')
|
@@ -86,7 +225,6 @@ describe LogStash::Outputs::Scalyr do
|
|
86
225
|
result = plugin.build_multi_event_request_array(sample_events)
|
87
226
|
body = JSON.parse(result[0][:body])
|
88
227
|
expect(body['events'].size).to eq(3)
|
89
|
-
attrs2 = body['events'][2]['attrs']
|
90
228
|
logattrs2 = body['logs'][2]['attrs']
|
91
229
|
expect(logattrs2.fetch('serverHost', nil)).to eq('my host 3')
|
92
230
|
expect(logattrs2.fetch('logfile', nil)).to eq('my file 3')
|
@@ -181,72 +319,4 @@ describe LogStash::Outputs::Scalyr do
|
|
181
319
|
end
|
182
320
|
end
|
183
321
|
end
|
184
|
-
|
185
|
-
describe "#ssl_tests" do
|
186
|
-
context "with default SSL configuration" do
|
187
|
-
it "throws a ServerError due to fake api key" do
|
188
|
-
expect {
|
189
|
-
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234'})
|
190
|
-
plugin.register
|
191
|
-
plugin.multi_receive(sample_events)
|
192
|
-
}.to raise_error(Scalyr::Common::Client::ServerError, "error/client/badParam")
|
193
|
-
end
|
194
|
-
end
|
195
|
-
|
196
|
-
context "when pointing at a location without any valid certs and not using builtin" do
|
197
|
-
it "throws an SSLError" do
|
198
|
-
expect {
|
199
|
-
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'ssl_ca_bundle_path' => '/fakepath/nocerts', 'append_builtin_cert' => false})
|
200
|
-
plugin.register
|
201
|
-
plugin.multi_receive(sample_events)
|
202
|
-
}.to raise_error(OpenSSL::SSL::SSLError, "certificate verify failed")
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
context "when system certs are missing and not using builtin" do
|
207
|
-
it "throws an SSLError" do
|
208
|
-
`sudo mv #{OpenSSL::X509::DEFAULT_CERT_FILE} /tmp/system_cert.pem`
|
209
|
-
`sudo mv #{OpenSSL::X509::DEFAULT_CERT_DIR} /tmp/system_certs`
|
210
|
-
|
211
|
-
begin
|
212
|
-
expect {
|
213
|
-
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'append_builtin_cert' => false})
|
214
|
-
plugin.register
|
215
|
-
plugin.multi_receive(sample_events)
|
216
|
-
}.to raise_error(OpenSSL::SSL::SSLError, "certificate verify failed")
|
217
|
-
end
|
218
|
-
ensure
|
219
|
-
`sudo mv /tmp/system_certs #{OpenSSL::X509::DEFAULT_CERT_DIR}`
|
220
|
-
`sudo mv /tmp/system_cert.pem #{OpenSSL::X509::DEFAULT_CERT_FILE}`
|
221
|
-
end
|
222
|
-
end
|
223
|
-
|
224
|
-
context "when server hostname doesn't match the cert" do
|
225
|
-
it "throws an SSLError" do
|
226
|
-
agent_scalyr_com_ip = `dig +short agent.scalyr.com 2> /dev/null | tail -n 1 | tr -d "\n"`
|
227
|
-
if agent_scalyr_com_ip.empty?
|
228
|
-
agent_scalyr_com_ip = `getent hosts agent.scalyr.com \
|
229
|
-
| awk '{ print $1 }' | tail -n 1 | tr -d "\n"`
|
230
|
-
end
|
231
|
-
mock_host = "invalid.mitm.should.fail.test.agent.scalyr.com"
|
232
|
-
etc_hosts_entry = "#{agent_scalyr_com_ip} #{mock_host}"
|
233
|
-
hosts_bkp = `sudo cat /etc/hosts`
|
234
|
-
hosts_bkp = hosts_bkp.chomp
|
235
|
-
# Add mock /etc/hosts entry and config scalyr_server entry
|
236
|
-
`echo "#{etc_hosts_entry}" | sudo tee -a /etc/hosts`
|
237
|
-
|
238
|
-
begin
|
239
|
-
expect {
|
240
|
-
plugin = LogStash::Outputs::Scalyr.new({'api_write_token' => '1234', 'scalyr_server' => 'https://invalid.mitm.should.fail.test.agent.scalyr.com:443'})
|
241
|
-
plugin.register
|
242
|
-
plugin.multi_receive(sample_events)
|
243
|
-
}.to raise_error(OpenSSL::SSL::SSLError, "hostname \"invalid.mitm.should.fail.test.agent.scalyr.com\" does not match the server certificate")
|
244
|
-
ensure
|
245
|
-
# Clean up the hosts file
|
246
|
-
`sudo truncate -s 0 /etc/hosts`
|
247
|
-
`echo "#{hosts_bkp}" | sudo tee -a /etc/hosts`
|
248
|
-
end
|
249
|
-
end
|
250
|
-
end
|
251
|
-
end
|
252
322
|
end
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|