This repository has been archived by the owner on Dec 31, 2024. It is now read-only.
forked from jhoblitt/puppet-nsstools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change nssdb::add_cert type to treat it's title as the default nickname
Previously, the title was being used as the default cert param value.
- Loading branch information
Joshua Hoblitt
committed
Feb 10, 2014
1 parent
a733330
commit e22a87a
Showing
2 changed files
with
56 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,55 @@ | ||
require 'spec_helper' | ||
|
||
describe 'nssdb::add_cert', :type => :define do | ||
let(:title) { '/dne' } | ||
let(:params) do | ||
{ | ||
:nickname => 'GlobalSign Root CA', | ||
:cert => '/tmp/server.crt', | ||
:certdir => '/dne', | ||
} | ||
end | ||
context 'default params' do | ||
let(:title) { 'GlobalSign Root CA' } | ||
let(:params) do | ||
{ | ||
:certdir => '/dne', | ||
:cert => '/tmp/server.crt', | ||
} | ||
end | ||
|
||
context 'add_cert' do | ||
it do | ||
should contain_exec('add_cert_GlobalSign Root CA').with( | ||
:path => ['/usr/bin'], | ||
:command => "certutil -d /dne -A -n 'GlobalSign Root CA' -t 'CT,,' -a -i /tmp/server.crt", | ||
:unless => "certutil -d /dne -L -n 'GlobalSign Root CA'", | ||
:logoutput => true, | ||
:require => [ | ||
'Nssdb::Create[/dne]', | ||
'Class[Nssdb]' | ||
] | ||
) | ||
end | ||
end | ||
end # default params | ||
|
||
context 'all params' do | ||
let(:title) { 'foo' } | ||
let(:params) do | ||
{ | ||
:certdir => '/dne', | ||
:cert => '/tmp/server.crt', | ||
:nickname => 'GlobalSign Root CA', | ||
:trustargs => 'u,u,u', | ||
} | ||
end | ||
|
||
context 'add_cert' do | ||
it do | ||
should contain_exec('add_cert_/dne').with( | ||
:path => ['/usr/bin'], | ||
:command => "certutil -d /dne -A -n 'GlobalSign Root CA' -t 'CT,,' -a -i /tmp/server.crt", | ||
:unless => "certutil -d /dne -L -n 'GlobalSign Root CA'", | ||
:logoutput => true, | ||
:require => [ | ||
'Nssdb::Create[/dne]', | ||
'Class[Nssdb]' | ||
] | ||
) | ||
context 'add_cert' do | ||
it do | ||
should contain_exec('add_cert_foo').with( | ||
:path => ['/usr/bin'], | ||
:command => "certutil -d /dne -A -n 'GlobalSign Root CA' -t 'u,u,u' -a -i /tmp/server.crt", | ||
:unless => "certutil -d /dne -L -n 'GlobalSign Root CA'", | ||
:logoutput => true, | ||
:require => [ | ||
'Nssdb::Create[/dne]', | ||
'Class[Nssdb]' | ||
] | ||
) | ||
end | ||
end | ||
end | ||
end # all params | ||
end |