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
fluentd222-1.16.2-x86_64-linux test/plugin_helper/test_cert_option.rb
fluentd-1.16.3-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.3-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.3-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.16.3 test/plugin_helper/test_cert_option.rb
fluentd-1.16.2-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.2-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.2-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.16.2 test/plugin_helper/test_cert_option.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/fluentd-1.16.1/test/plugin_helper/test_cert_option.rb
fluentd-1.16.1-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.16.1-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.1-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.1 test/plugin_helper/test_cert_option.rb
fluentd-1.16.0-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.16.0-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.16.0 test/plugin_helper/test_cert_option.rb
fluentd-1.15.3-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.15.3-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.15.3-x64-mingw32 test/plugin_helper/test_cert_option.rb