forked from jhoblitt/puppet-nsstools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace concept of <basedir>/<dbname> with just <certdir> for flexibi…
…lity - replaces dbname, basedir params with certdir in nssdb::create & nssdb::add_cert_and_key - add certdir_mode, manage_certdir params to nssdb::create - also convert to 2 space indent + linter fixes
- Loading branch information
Joshua Hoblitt
committed
Jan 14, 2014
1 parent
2145c2b
commit 041e0e1
Showing
4 changed files
with
214 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
require 'spec_helper' | ||
|
||
describe 'nssdb::add_cert_and_key', :type => :define do | ||
let(:title) { 'qpidd' } | ||
let(:params) do { | ||
:nickname => 'Server-Cert', | ||
:cert => '/tmp/server.cert', | ||
:key => '/tmp/server.key', | ||
:basedir => '/obsolete' | ||
} | ||
end | ||
let(:title) { '/dne' } | ||
let(:params) do | ||
{ | ||
:nickname => 'Server-Cert', | ||
:cert => '/tmp/server.cert', | ||
:key => '/tmp/server.key', | ||
} | ||
end | ||
|
||
context 'generate_pkcs12' do | ||
it{ should contain_exec('generate_pkcs12').with( | ||
:command => %r{-in /tmp/server.cert -inkey /tmp/server.key.*file:/obsolete/qpidd.*out \'/obsolete/qpidd/qpidd.p12\' -name Server-Cert}, | ||
:require => [ 'File[/obsolete/qpidd/password.conf]', | ||
'File[/obsolete/qpidd/cert8.db]', | ||
'Package[openssl]' ], | ||
:subscribe => 'File[/obsolete/qpidd/password.conf]' | ||
)} | ||
end | ||
context 'generate_pkcs12' do | ||
it do | ||
should contain_exec('generate_pkcs12').with( | ||
:command => "/usr/bin/openssl pkcs12 -export -in /tmp/server.cert -inkey /tmp/server.key -password 'file:/dne/password.conf' -out '/dne/server-cert.p12' -name 'Server-Cert'", | ||
:require => [ | ||
'File[/dne/password.conf]', | ||
'File[/dne/cert8.db]', | ||
'Package[openssl]' | ||
], | ||
:subscribe => 'File[/dne/password.conf]' | ||
) | ||
end | ||
end | ||
|
||
context 'load_pkcs12' do | ||
it{ should contain_exec('load_pkcs12').with( | ||
:command => %r{-i \'/obsolete/qpidd/qpidd.p12\' -d \'/obsolete/qpidd\' -w \'/obsolete/qpidd.*-k \'/obsolete/qpidd} | ||
)} | ||
end | ||
context 'load_pkcs12' do | ||
it do | ||
contain_exec('load_pkcs12').with( | ||
:command => "/usr/bin/pk12util -i '/dne/${pkcs12_name}' -d '/dne' -w '/dne/password.conf' -k '/dne/password.conf'" | ||
) | ||
end | ||
end | ||
|
||
end |
Oops, something went wrong.