Sha256: 26ed2a0825060b387f2c39201986d04088909f9136ec71a23bedc05c5fe115a8

Contents?: true

Size: 910 Bytes

Versions: 66

Compression:

Stored size: 910 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
      certs = d.cert_option_certificates_from_file("test/plugin_helper/data/cert/empty.pem")
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
fluentd-1.14.6-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.6-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.14.6-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.6 test/plugin_helper/test_cert_option.rb
fluentd-1.14.5-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.14.5-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.5-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.5 test/plugin_helper/test_cert_option.rb
fluentd-1.14.4-x64-mingw-ucrt test/plugin_helper/test_cert_option.rb
fluentd-1.14.4-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.4-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.4 test/plugin_helper/test_cert_option.rb
fluentd-1.14.3-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.3-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.3 test/plugin_helper/test_cert_option.rb
fluentd-1.14.2-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.2-x64-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.2 test/plugin_helper/test_cert_option.rb
fluentd-1.14.1-x86-mingw32 test/plugin_helper/test_cert_option.rb
fluentd-1.14.1-x64-mingw32 test/plugin_helper/test_cert_option.rb