summaryrefslogtreecommitdiffstats
path: root/spec/integration/ssl/certificate_revocation_list_spec.rb
blob: d140fd950ee11b0641984565711b7459e1a317ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env rspec
#
#  Created by Luke Kanies on 2008-5-5.
#  Copyright (c) 2008. All rights reserved.

require 'spec_helper'

require 'puppet/ssl/certificate_revocation_list'

# REMIND: Fails on windows because there is no user provider yet
describe Puppet::SSL::CertificateRevocationList, :fails_on_windows => true do
  include PuppetSpec::Files

  before do
    # Get a safe temporary file
    dir = tmpdir("ca_integration_testing")

    Puppet.settings[:confdir] = dir
    Puppet.settings[:vardir] = dir
    Puppet.settings[:group] = Process.gid

    Puppet::SSL::Host.ca_location = :local
  end

  after {
    Puppet::SSL::Host.ca_location = :none

    Puppet.settings.clear

    # This is necessary so the terminus instances don't lie around.
    Puppet::SSL::Host.indirection.termini.clear
  }

  it "should be able to read in written out CRLs with no revoked certificates" do
    ca = Puppet::SSL::CertificateAuthority.new

    raise "CRL not created" unless FileTest.exist?(Puppet[:hostcrl])

    crl = Puppet::SSL::CertificateRevocationList.new("crl_int_testing")
    crl.read(Puppet[:hostcrl])
  end
end