|
6 | 6 | on_supported_os.each do |os, os_facts|
|
7 | 7 | context "on #{os}" do
|
8 | 8 | let(:facts) { os_facts }
|
9 |
| - let :params do |
10 |
| - { |
11 |
| - country: 'CH', |
12 |
| - organization: 'Existing Ltd', |
13 |
| - conffiles: { |
14 |
| - '/path/to/openssl.conf' => { 'country' => 'US', 'commonname' => 'servername.xyz.org' }, |
15 |
| - '/other/path/to/openssl.conf' => { 'group' => 'vpn', 'commonname' => ['test.ch', 'test2.ch'] }, |
16 |
| - '/absent.conf' => { 'ensure' => 'absent', 'commonname' => 'blah' }, |
17 |
| - }, |
| 9 | + |
| 10 | + context 'without ownership defaults' do |
| 11 | + let :params do |
| 12 | + { |
| 13 | + country: 'CH', |
| 14 | + organization: 'Existing Ltd', |
| 15 | + conffiles: { |
| 16 | + '/path/to/openssl.conf' => { 'country' => 'US', 'commonname' => 'servername.xyz.org' }, |
| 17 | + '/other/path/to/openssl.conf' => { 'group' => 'vpn', 'commonname' => ['test.ch', 'test2.ch'] }, |
| 18 | + '/absent.conf' => { 'ensure' => 'absent', 'commonname' => 'blah' }, |
| 19 | + }, |
| 20 | + } |
| 21 | + end |
| 22 | + |
| 23 | + it { is_expected.to compile } |
| 24 | + |
| 25 | + it { |
| 26 | + is_expected.to contain_file('/path/to/openssl.conf'). |
| 27 | + with_ensure('present'). |
| 28 | + with_owner('root'). |
| 29 | + with_mode('0640') |
| 30 | + } |
| 31 | + |
| 32 | + it { |
| 33 | + is_expected.to contain_file('/other/path/to/openssl.conf'). |
| 34 | + with_ensure('present'). |
| 35 | + with_owner('root'). |
| 36 | + with_group('vpn'). |
| 37 | + with_mode('0640') |
| 38 | + } |
| 39 | + |
| 40 | + it { |
| 41 | + is_expected.to contain_file('/absent.conf'). |
| 42 | + with_ensure('absent') |
18 | 43 | }
|
19 | 44 | end
|
20 | 45 |
|
21 |
| - it { is_expected.to compile } |
22 |
| - |
23 |
| - it { |
24 |
| - is_expected.to contain_file('/path/to/openssl.conf'). |
25 |
| - with_ensure('present'). |
26 |
| - with_owner('root'). |
27 |
| - with_mode('0640') |
28 |
| - } |
29 |
| - |
30 |
| - it { |
31 |
| - is_expected.to contain_file('/other/path/to/openssl.conf'). |
32 |
| - with_ensure('present'). |
33 |
| - with_owner('root'). |
34 |
| - with_group('vpn'). |
35 |
| - with_mode('0640') |
36 |
| - } |
37 |
| - |
38 |
| - it { |
39 |
| - is_expected.to contain_file('/absent.conf'). |
40 |
| - with_ensure('absent') |
41 |
| - } |
| 46 | + context 'with ownership defaults' do |
| 47 | + let :params do |
| 48 | + { |
| 49 | + owner: 'someone', |
| 50 | + group: 'somegroup', |
| 51 | + mode: '0000', |
| 52 | + conffiles: { |
| 53 | + '/path/to/openssl.conf' => { 'commonname' => 'servername.xyz.org' }, |
| 54 | + '/tmp/openssl.conf' => { 'commonname' => 'some', 'owner' => 'whoever', 'group' => 'agroup', 'mode' => '1111' }, |
| 55 | + }, |
| 56 | + } |
| 57 | + end |
| 58 | + |
| 59 | + it { |
| 60 | + is_expected.to contain_file('/path/to/openssl.conf'). |
| 61 | + with_ensure('present'). |
| 62 | + with_owner('someone'). |
| 63 | + with_group('somegroup'). |
| 64 | + with_mode('0000') |
| 65 | + } |
| 66 | + |
| 67 | + it { |
| 68 | + is_expected.to contain_file('/tmp/openssl.conf'). |
| 69 | + with_ensure('present'). |
| 70 | + with_owner('whoever'). |
| 71 | + with_group('agroup'). |
| 72 | + with_mode('1111') |
| 73 | + } |
| 74 | + end |
42 | 75 | end
|
43 | 76 | end
|
44 | 77 | end
|
0 commit comments