Sha256: a3d26d430bd5b66fe06d4d004a442501d6cd8b6eb69925ef97b094844f617838

Contents?: true

Size: 870 Bytes

Versions: 36

Compression:

Stored size: 870 Bytes

Contents

require 'spec_helper'
require 'puppet/indirector/key/disabled_ca'

describe Puppet::SSL::Key::DisabledCa do
  def request(type, remote)
    r = Puppet::Indirector::Request.new(:key, 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::Key.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/key/disabled_ca_spec.rb
puppet-5.5.22-x86-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.22-x64-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.22-universal-darwin spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.21 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.21-x86-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.21-x64-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.21-universal-darwin spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.20 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.20-x86-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.20-x64-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.20-universal-darwin spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.19 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.19-x86-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.19-x64-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.19-universal-darwin spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.18 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.18-x86-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.18-x64-mingw32 spec/unit/indirector/key/disabled_ca_spec.rb
puppet-5.5.18-universal-darwin spec/unit/indirector/key/disabled_ca_spec.rb