Sha256: ae739c48a1e2b0a9c1554b5394219a9fff5b1831470a80695b23ff01a3d814c6

Contents?: true

Size: 1.1 KB

Versions: 40

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

set :os, :family => 'linux'

describe x509_certificate('test.pem') do
  let(:exit_status) { 0 }
  it { should be_certificate }
end

describe x509_certificate('test.pem') do
  let(:exit_status) { 1 }
  it { should_not be_certificate }
end

describe x509_certificate('test.pem') do
  let(:stdout) { sample_subj }
  its(:subject) { should eq '/O=some/OU=thing' }
end

describe x509_certificate('test.pem') do
  let(:stdout) { sample_issuer }
  its(:issuer) { should eq '/O=some/OU=issuer' }
end

describe x509_certificate('test.pem') do
  let(:stdout) { sample_validity }
  it { should be_valid }
  its(:validity_in_days) { should be >= 1000 }
end

describe x509_certificate('test.pem') do
  let(:stdout) { sample_validity2 }
  it { should_not be_valid }
end


def sample_subj
  <<'EOS'
subject= /O=some/OU=thing
EOS
end

def sample_issuer
  <<'EOS'
issuer= /O=some/OU=issuer
EOS
end

def sample_validity
  <<'EOS'
notBefore=Jul  1 11:11:00 2000 GMT
notAfter=Jul  1 11:11:00 2050 GMT
EOS
end

def sample_validity2
  <<'EOS'
notBefore=Jul  1 11:11:00 2000 GMT
notAfter=Jul  1 11:11:00 2010 GMT
EOS
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
serverspec-ruby19-2.24.3 spec/type/linux/x509_certificate_spec.rb
serverspec-2.35.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.34.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.33.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.32.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.31.1 spec/type/linux/x509_certificate_spec.rb
serverspec-2.31.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.30.1 spec/type/linux/x509_certificate_spec.rb
serverspec-2.30.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.29.2 spec/type/linux/x509_certificate_spec.rb
serverspec-2.29.1 spec/type/linux/x509_certificate_spec.rb
serverspec-2.29.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.28.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.27.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.26.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.25.0 spec/type/linux/x509_certificate_spec.rb
serverspec-2.24.3 spec/type/linux/x509_certificate_spec.rb
serverspec-2.24.2 spec/type/linux/x509_certificate_spec.rb
serverspec-2.24.1 spec/type/linux/x509_certificate_spec.rb
serverspec-2.24.0 spec/type/linux/x509_certificate_spec.rb