|
1 | 1 | require 'spec_helper' |
2 | 2 |
|
3 | | -describe 'pureftpd::config_ldap' do |
| 3 | +describe 'pureftpd::config::ldap' do |
4 | 4 | let(:facts) {{ :osfamily=> 'RedHat' }} |
5 | 5 |
|
6 | 6 | describe 'with no params' do |
7 | 7 | it do |
8 | | - should contain_class('pureftpd::config_ldap') |
| 8 | + should contain_class('pureftpd::config::ldap') |
9 | 9 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
10 | 10 | .with_ensure('file').with_content('') |
11 | 11 | end |
|
14 | 14 | describe 'with ldapport' do |
15 | 15 | let(:params) {{ :ldapport => '389' }} |
16 | 16 | it do |
17 | | - should contain_class('pureftpd::config_ldap') |
| 17 | + should contain_class('pureftpd::config::ldap') |
18 | 18 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
19 | 19 | .with_ensure('file') \ |
20 | 20 | .with_content(/^LDAPPort 389/) |
|
24 | 24 | describe 'with ldapbinddn' do |
25 | 25 | let(:params) {{ :ldapbinddn => 'cn=Manager,dc=c9x,dc=org' }} |
26 | 26 | it do |
27 | | - should contain_class('pureftpd::config_ldap') |
| 27 | + should contain_class('pureftpd::config::ldap') |
28 | 28 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
29 | 29 | .with_ensure('file') \ |
30 | 30 | .with_content(/^LDAPBindDN cn=Manager,dc=c9x,dc=org/) |
|
34 | 34 | describe 'with ldapbindpw' do |
35 | 35 | let(:params) {{ :ldapbindpw => 'r00tPaSsw0rD' }} |
36 | 36 | it do |
37 | | - should contain_class('pureftpd::config_ldap') |
| 37 | + should contain_class('pureftpd::config::ldap') |
38 | 38 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
39 | 39 | .with_ensure('file') \ |
40 | 40 | .with_content(/^LDAPBindPW r00tPaSsw0rD/) |
|
44 | 44 | describe 'with ldapbasedn' do |
45 | 45 | let(:params) {{ :ldapbasedn => 'cn=Users,dc=c9x,dc=org' }} |
46 | 46 | it do |
47 | | - should contain_class('pureftpd::config_ldap') |
| 47 | + should contain_class('pureftpd::config::ldap') |
48 | 48 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
49 | 49 | .with_ensure('file') \ |
50 | 50 | .with_content(/^LDAPBaseDN cn=Users,dc=c9x,dc=org/) |
|
54 | 54 | describe 'with ldapfilter' do |
55 | 55 | let(:params) {{ :ldapfilter => '(&(objectClass=posixAccount)(uid=\L))' }} |
56 | 56 | it do |
57 | | - should contain_class('pureftpd::config_ldap') |
| 57 | + should contain_class('pureftpd::config::ldap') |
58 | 58 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
59 | 59 | .with_ensure('file') \ |
60 | 60 | .with_content(Regexp.new(Regexp.quote('LDAPFilter (&(objectClass=posixAccount)(uid=\L))'))) |
|
64 | 64 | describe 'with ldaphomedir' do |
65 | 65 | let(:params) {{ :ldaphomedir => 'homeDirectory' }} |
66 | 66 | it do |
67 | | - should contain_class('pureftpd::config_ldap') |
| 67 | + should contain_class('pureftpd::config::ldap') |
68 | 68 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
69 | 69 | .with_ensure('file') \ |
70 | 70 | .with_content(/^LDAPHomeDir homeDirectory/) |
|
74 | 74 | describe 'with ldapversion' do |
75 | 75 | let(:params) {{ :ldapversion => '3' }} |
76 | 76 | it do |
77 | | - should contain_class('pureftpd::config_ldap') |
| 77 | + should contain_class('pureftpd::config::ldap') |
78 | 78 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
79 | 79 | .with_ensure('file') \ |
80 | 80 | .with_content(/^LDAPVersion 3/) |
|
84 | 84 | describe 'with ldapdefaultuid' do |
85 | 85 | let(:params) {{ :ldapdefaultuid => '100' }} |
86 | 86 | it do |
87 | | - should contain_class('pureftpd::config_ldap') |
| 87 | + should contain_class('pureftpd::config::ldap') |
88 | 88 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
89 | 89 | .with_ensure('file') \ |
90 | 90 | .with_content(/^LDAPDefaultUID 100/) |
|
94 | 94 | describe 'with ldapforcedefaultuid' do |
95 | 95 | let(:params) {{ :ldapforcedefaultuid => 'False' }} |
96 | 96 | it do |
97 | | - should contain_class('pureftpd::config_ldap') |
| 97 | + should contain_class('pureftpd::config::ldap') |
98 | 98 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
99 | 99 | .with_ensure('file') \ |
100 | 100 | .with_content(/^LDAPForceDefaultUID False/) |
|
104 | 104 | describe 'with ldapdefaultgid' do |
105 | 105 | let(:params) {{ :ldapdefaultgid => '100' }} |
106 | 106 | it do |
107 | | - should contain_class('pureftpd::config_ldap') |
| 107 | + should contain_class('pureftpd::config::ldap') |
108 | 108 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
109 | 109 | .with_ensure('file') \ |
110 | 110 | .with_content(/^LDAPDefaultGID 100/) |
|
114 | 114 | describe 'with ldapdefaultgid' do |
115 | 115 | let(:params) {{ :ldapdefaultgid => '100' }} |
116 | 116 | it do |
117 | | - should contain_class('pureftpd::config_ldap') |
| 117 | + should contain_class('pureftpd::config::ldap') |
118 | 118 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
119 | 119 | .with_ensure('file') \ |
120 | 120 | .with_content(/^LDAPDefaultGID 100/) |
|
124 | 124 | describe 'with ldapforcedefaultgid' do |
125 | 125 | let(:params) {{ :ldapforcedefaultgid => 'False' }} |
126 | 126 | it do |
127 | | - should contain_class('pureftpd::config_ldap') |
| 127 | + should contain_class('pureftpd::config::ldap') |
128 | 128 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
129 | 129 | .with_ensure('file') \ |
130 | 130 | .with_content(/^LDAPForceDefaultGID False/) |
|
134 | 134 | describe 'with ldapusetls' do |
135 | 135 | let(:params) {{ :ldapusetls => 'False' }} |
136 | 136 | it do |
137 | | - should contain_class('pureftpd::config_ldap') |
| 137 | + should contain_class('pureftpd::config::ldap') |
138 | 138 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
139 | 139 | .with_ensure('file') \ |
140 | 140 | .with_content(/^LDAPUseTLS False/) |
|
144 | 144 | describe 'with ldapauthmethod' do |
145 | 145 | let(:params) {{ :ldapauthmethod => 'PASSWORD' }} |
146 | 146 | it do |
147 | | - should contain_class('pureftpd::config_ldap') |
| 147 | + should contain_class('pureftpd::config::ldap') |
148 | 148 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
149 | 149 | .with_ensure('file') \ |
150 | 150 | .with_content(/^LDAPAuthMethod PASSWORD/) |
|
170 | 170 | :ldapauthmethod => 'PASSWORD', |
171 | 171 | }} |
172 | 172 | it do |
173 | | - should contain_class('pureftpd::config_ldap') |
| 173 | + should contain_class('pureftpd::config::ldap') |
174 | 174 | should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \ |
175 | 175 | .with_ensure('file') \ |
176 | 176 | .with_content(/^LDAPPort 389/) \ |
|
0 commit comments