Skip to content

Commit

Permalink
Add acceptance test for PKCS#12 generation
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Feb 10, 2025
1 parent c8b1a2a commit bf0f8b8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions examples/export_pkcs12_from_key.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include openssl
openssl::certificate::x509 { 'foo.example.com':
ensure => present,
country => 'CH',
organization => 'Example.com',
commonname => 'foo.example.com',
base_dir => '/tmp',
owner => 'nobody',
password => 'mahje1Qu',
# This is just to speed up CI - use 2048 or more in production
key_size => 1024,
}
openssl::export::pkcs12 { 'export.pkcs12':
ensure => 'present',
basedir => '/tmp',
pkey => '/tmp/foo.example.com.key',
cert => '/tmp/foo.example.com.key',
}
10 changes: 10 additions & 0 deletions spec/acceptance/pkcs12_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

require 'spec_helper_acceptance'

describe 'pkcs12 example' do
it_behaves_like 'the example', 'export_pkcs12_from_key.pp' do
it { expect(file('/tmp/foo.example.com.crt')).to be_file }
it { expect(file('/tmp/foo.example.com.key')).to be_file }
end
end

0 comments on commit bf0f8b8

Please sign in to comment.