Sha256: a4d2dc4b5e5d1c6a492163ca0eeccb15cb0b1e966c317db811f5964f1aad7f86

Contents?: true

Size: 902 Bytes

Versions: 36

Compression:

Stored size: 902 Bytes

Contents

require 'spec_helper'
require 'puppet/indirector/certificate/disabled_ca'

describe Puppet::SSL::Certificate::DisabledCa do
  def request(type, remote)
    r = Puppet::Indirector::Request.new(:certificate, type, "foo.com", nil)
    if remote
      r.ip   = '10.0.0.1'
      r.node = 'agent.example.com'
    end
    r
  end

  context "when not a CA" do
    before :each do
      Puppet[:ca] = false
      Puppet::SSL::Host.ca_location = :none
    end

    [:find, :head, :search, :save, :destroy].each do |name|
      it "should fail remote #{name} requests" do
        expect { subject.send(name, request(name, true)) }.
          to raise_error Puppet::Error, /is not a CA/
      end

      it "should forward local #{name} requests" do
        expect(Puppet::SSL::Certificate.indirection.terminus(:file)).to receive(name)
        subject.send(name, request(name, false))
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
puppet-5.5.17-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.17 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.17-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.17-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.16 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.16-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.16-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.16-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.14 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.14-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.14-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.14-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.13 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.13-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.13-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.13-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb