Sha256: e9facaae8d9bc19b91089325662232962d5f495092ca226a83ae943f30c11f4a

Contents?: true

Size: 902 Bytes

Versions: 55

Compression:

Stored size: 902 Bytes

Contents

require_relative '../helper'
require 'fluent/plugin_helper/cert_option'

class CertOptionPluginHelperTest < Test::Unit::TestCase
  class Dummy < Fluent::Plugin::TestBase
    helpers :cert_option
  end

  test 'can load PEM encoded certificate file' do
    d = Dummy.new
    certs = d.cert_option_certificates_from_file("test/plugin_helper/data/cert/cert.pem")
    assert_equal(1, certs.length)
    certs = d.cert_option_certificates_from_file("test/plugin_helper/data/cert/cert-with-no-newline.pem")
    assert_equal(1, certs.length)
    certs = d.cert_option_certificates_from_file("test/plugin_helper/data/cert/cert-with-CRLF.pem")
    assert_equal(1, certs.length)
  end

  test 'raise an error for broken certificates_from_file file' do
    d = Dummy.new
    assert_raise Fluent::ConfigError do
      d.cert_option_certificates_from_file("test/plugin_helper/data/cert/empty.pem")
    end
  end
end

Version data entries

55 entries across 55 versions & 7 rubygems

Version Path
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/test_cert_option.rb
fluentd-1.16.6-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.6-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.6-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.16.6 test/plugin_helper/test_cert_option.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/test_cert_option.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/test_cert_option.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/fluentd-1.17.0-x64-mingw-ucrt/test/plugin_helper/test_cert_option.rb
fluentd-1.17.0-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.17.0-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.17.0-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.17.0 test/plugin_helper/test_cert_option.rb
fluentd-1.16.5-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.16.5-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.5-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.5 test/plugin_helper/test_cert_option.rb
fluentd-1.16.4-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.16.4-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.4-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.4 test/plugin_helper/test_cert_option.rb