|
11 | 11 | should include_class('pureftpd::service')
|
12 | 12 | should contain_package('pure-ftpd').with_ensure('present')
|
13 | 13 | should_not contain_package('pure-ftpd-selinux')
|
14 |
| - should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file') |
| 14 | + should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file')\ |
| 15 | + .with_content('') |
15 | 16 | should contain_service('pure-ftpd').with({
|
16 | 17 | 'ensure' => 'running',
|
17 | 18 | 'enable' => 'true',
|
|
28 | 29 | should include_class('pureftpd::service')
|
29 | 30 | should contain_package('pure-ftpd').with_ensure('present')
|
30 | 31 | should contain_package('pure-ftpd-selinux').with_ensure('present')
|
31 |
| - should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file') |
| 32 | + should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file')\ |
| 33 | + .with_content('') |
32 | 34 | should contain_service('pure-ftpd').with({
|
33 | 35 | 'ensure' => 'running',
|
34 | 36 | 'enable' => 'true',
|
|
45 | 47 | should include_class('pureftpd::service')
|
46 | 48 | should contain_package('pure-ftpd').with_ensure('present')
|
47 | 49 | should_not contain_package('pure-ftpd-selinux')
|
48 |
| - should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file') |
| 50 | + should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file')\ |
| 51 | + .with_content('') |
49 | 52 | should contain_service('pure-ftpd').with({
|
50 | 53 | 'ensure' => 'running',
|
51 | 54 | 'enable' => 'true',
|
|
71 | 74 | should include_class('pureftpd::service')
|
72 | 75 | should contain_package('pure-ftpd').with_ensure('present')
|
73 | 76 | should_not contain_package('pure-ftpd-selinux')
|
74 |
| - should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file') |
| 77 | + should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file')\ |
| 78 | + .with_content('') |
75 | 79 | should contain_service('pure-ftpd').with({
|
76 | 80 | 'ensure' => 'running',
|
77 | 81 | 'enable' => 'true',
|
|
80 | 84 | end
|
81 | 85 |
|
82 | 86 | describe 'with $config keys' do
|
83 |
| - let(:params) {{ :config => { 'daemonize' => 'Yes', 'ipv4only' => 'No'} }} |
| 87 | + let(:params) {{ |
| 88 | + :config => { |
| 89 | + 'daemonize' => 'Yes', |
| 90 | + 'ipv4only' => 'No', |
| 91 | + } |
| 92 | + }} |
84 | 93 | it do
|
85 | 94 | should include_class('pureftpd')
|
86 | 95 | should include_class('pureftpd::install')
|
|
108 | 117 | }.to raise_error(Puppet::Error, /is not a Hash/)
|
109 | 118 | end
|
110 | 119 | end
|
| 120 | + |
| 121 | + describe 'with $config_ldap => { ldapserver => ldap.example.com }' do |
| 122 | + let(:params) {{ |
| 123 | + :config_ldap => { |
| 124 | + 'ldapserver' => 'ldap.example.com', |
| 125 | + 'ldapport' => '389', |
| 126 | + } |
| 127 | + }} |
| 128 | + it do |
| 129 | + should include_class('pureftpd') |
| 130 | + should include_class('pureftpd::install') |
| 131 | + should include_class('pureftpd::config') |
| 132 | + should include_class('pureftpd::config::ldap') |
| 133 | + should include_class('pureftpd::service') |
| 134 | + should contain_package('pure-ftpd').with_ensure('present') |
| 135 | + should_not contain_package('pure-ftpd-selinux') |
| 136 | + should contain_file('/etc/pure-ftpd/pure-ftpd.conf').with_ensure('file') \ |
| 137 | + .with_content(<<-END.gsub(/^\s+/, "")) |
| 138 | + LDAPConfigFile /etc/pure-ftpd/pureftpd-ldap.conf |
| 139 | + END |
| 140 | + should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf').with_ensure('file') \ |
| 141 | + .with_content(<<-END.gsub(/^\s+/, "")) |
| 142 | + LDAPServer ldap.example.com |
| 143 | + LDAPPort 389 |
| 144 | + END |
| 145 | + should contain_service('pure-ftpd').with({ |
| 146 | + 'ensure' => 'running', |
| 147 | + 'enable' => 'true', |
| 148 | + }) |
| 149 | + end |
| 150 | + end |
| 151 | + |
111 | 152 | end
|
0 commit comments