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.22 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.22-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.22-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.22-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.21 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.21-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.21-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.21-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.20 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.20-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.20-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.20-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.19 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.19-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.19-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.19-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.18 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.18-x86-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.18-x64-mingw32 spec/unit/indirector/certificate/disabled_ca_spec.rb
puppet-5.5.18-universal-darwin spec/unit/indirector/certificate/disabled_ca_spec.rb