|
1 | 1 | require 'spec_helper'
|
2 | 2 |
|
3 | 3 | describe 'nssdb::add_cert', :type => :define do
|
4 |
| - let(:title) { '/dne' } |
5 |
| - let(:params) do |
6 |
| - { |
7 |
| - :nickname => 'GlobalSign Root CA', |
8 |
| - :cert => '/tmp/server.crt', |
9 |
| - :certdir => '/dne', |
10 |
| - } |
11 |
| - end |
| 4 | + context 'default params' do |
| 5 | + let(:title) { 'GlobalSign Root CA' } |
| 6 | + let(:params) do |
| 7 | + { |
| 8 | + :certdir => '/dne', |
| 9 | + :cert => '/tmp/server.crt', |
| 10 | + } |
| 11 | + end |
| 12 | + |
| 13 | + context 'add_cert' do |
| 14 | + it do |
| 15 | + should contain_exec('add_cert_GlobalSign Root CA').with( |
| 16 | + :path => ['/usr/bin'], |
| 17 | + :command => "certutil -d /dne -A -n 'GlobalSign Root CA' -t 'CT,,' -a -i /tmp/server.crt", |
| 18 | + :unless => "certutil -d /dne -L -n 'GlobalSign Root CA'", |
| 19 | + :logoutput => true, |
| 20 | + :require => [ |
| 21 | + 'Nssdb::Create[/dne]', |
| 22 | + 'Class[Nssdb]' |
| 23 | + ] |
| 24 | + ) |
| 25 | + end |
| 26 | + end |
| 27 | + end # default params |
| 28 | + |
| 29 | + context 'all params' do |
| 30 | + let(:title) { 'foo' } |
| 31 | + let(:params) do |
| 32 | + { |
| 33 | + :certdir => '/dne', |
| 34 | + :cert => '/tmp/server.crt', |
| 35 | + :nickname => 'GlobalSign Root CA', |
| 36 | + :trustargs => 'u,u,u', |
| 37 | + } |
| 38 | + end |
12 | 39 |
|
13 |
| - context 'add_cert' do |
14 |
| - it do |
15 |
| - should contain_exec('add_cert_/dne').with( |
16 |
| - :path => ['/usr/bin'], |
17 |
| - :command => "certutil -d /dne -A -n 'GlobalSign Root CA' -t 'CT,,' -a -i /tmp/server.crt", |
18 |
| - :unless => "certutil -d /dne -L -n 'GlobalSign Root CA'", |
19 |
| - :logoutput => true, |
20 |
| - :require => [ |
21 |
| - 'Nssdb::Create[/dne]', |
22 |
| - 'Class[Nssdb]' |
23 |
| - ] |
24 |
| - ) |
| 40 | + context 'add_cert' do |
| 41 | + it do |
| 42 | + should contain_exec('add_cert_foo').with( |
| 43 | + :path => ['/usr/bin'], |
| 44 | + :command => "certutil -d /dne -A -n 'GlobalSign Root CA' -t 'u,u,u' -a -i /tmp/server.crt", |
| 45 | + :unless => "certutil -d /dne -L -n 'GlobalSign Root CA'", |
| 46 | + :logoutput => true, |
| 47 | + :require => [ |
| 48 | + 'Nssdb::Create[/dne]', |
| 49 | + 'Class[Nssdb]' |
| 50 | + ] |
| 51 | + ) |
| 52 | + end |
25 | 53 | end
|
26 |
| - end |
| 54 | + end # all params |
27 | 55 | end
|
0 commit comments