|
49 | 49 |
|
50 | 50 | end |
51 | 51 |
|
52 | | - it_configures 'with SSL enabled' |
| 52 | + it_configures 'with SSL enabled with kombu' |
| 53 | + it_configures 'with SSL enabled without kombu' |
53 | 54 | it_configures 'with SSL disabled' |
54 | 55 | it_configures 'with SSL wrongly configured' |
| 56 | + it_configures 'with SSL and kombu wrongly configured' |
55 | 57 | it_configures 'with SSL socket options set' |
56 | 58 | it_configures 'with SSL socket options set with wrong parameters' |
57 | 59 | it_configures 'with SSL socket options set to false' |
|
215 | 217 | it { should contain_neutron_config('DEFAULT/use_syslog').with_value(false) } |
216 | 218 | end |
217 | 219 |
|
218 | | - shared_examples_for 'with SSL enabled' do |
| 220 | + shared_examples_for 'with SSL enabled with kombu' do |
219 | 221 | before do |
220 | 222 | params.merge!( |
221 | 223 | :rabbit_use_ssl => true, |
|
235 | 237 | end |
236 | 238 | end |
237 | 239 |
|
| 240 | + shared_examples_for 'with SSL enabled without kombu' do |
| 241 | + before do |
| 242 | + params.merge!( |
| 243 | + :rabbit_use_ssl => true |
| 244 | + ) |
| 245 | + end |
| 246 | + |
| 247 | + it do |
| 248 | + should contain_neutron_config('DEFAULT/rabbit_use_ssl').with_value('true') |
| 249 | + should contain_neutron_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') |
| 250 | + should contain_neutron_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') |
| 251 | + should contain_neutron_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') |
| 252 | + should contain_neutron_config('DEFAULT/kombu_ssl_version').with_value('SSLv3') |
| 253 | + end |
| 254 | + end |
| 255 | + |
238 | 256 | shared_examples_for 'with SSL disabled' do |
239 | 257 | before do |
240 | 258 | params.merge!( |
241 | 259 | :rabbit_use_ssl => false, |
242 | | - :kombu_ssl_ca_certs => 'undef', |
243 | | - :kombu_ssl_certfile => 'undef', |
244 | | - :kombu_ssl_keyfile => 'undef', |
245 | 260 | :kombu_ssl_version => 'SSLv3' |
246 | 261 | ) |
247 | 262 | end |
|
258 | 273 | shared_examples_for 'with SSL wrongly configured' do |
259 | 274 | before do |
260 | 275 | params.merge!( |
261 | | - :rabbit_use_ssl => true, |
262 | | - :kombu_ssl_ca_certs => 'undef', |
263 | | - :kombu_ssl_certfile => 'undef', |
264 | | - :kombu_ssl_keyfile => 'undef' |
| 276 | + :rabbit_use_ssl => false |
265 | 277 | ) |
266 | 278 | end |
267 | 279 |
|
268 | | - context 'without required parameters' do |
| 280 | + context 'with SSL disabled' do |
| 281 | + |
| 282 | + context 'with kombu_ssl_ca_certs parameter' do |
| 283 | + before { params.merge!(:kombu_ssl_ca_certs => '/path/to/ssl/ca/certs') } |
| 284 | + it_raises 'a Puppet::Error', /The kombu_ssl_ca_certs parameter requires rabbit_use_ssl to be set to true/ |
| 285 | + end |
269 | 286 |
|
270 | | - context 'without kombu_ssl_ca_certs parameter' do |
271 | | - before { params.delete(:kombu_ssl_ca_certs) } |
272 | | - it_raises 'a Puppet::Error', /The kombu_ssl_ca_certs parameter is required when rabbit_use_ssl is set to true/ |
| 287 | + context 'with kombu_ssl_certfile parameter' do |
| 288 | + before { params.merge!(:kombu_ssl_certfile => '/path/to/ssl/cert/file') } |
| 289 | + it_raises 'a Puppet::Error', /The kombu_ssl_certfile parameter requires rabbit_use_ssl to be set to true/ |
273 | 290 | end |
274 | 291 |
|
275 | | - context 'without kombu_ssl_certfile parameter' do |
276 | | - before { params.delete(:kombu_ssl_certfile) } |
277 | | - it_raises 'a Puppet::Error', /The kombu_ssl_certfile parameter is required when rabbit_use_ssl is set to true/ |
| 292 | + context 'with kombu_ssl_keyfile parameter' do |
| 293 | + before { params.merge!(:kombu_ssl_keyfile => '/path/to/ssl/keyfile') } |
| 294 | + it_raises 'a Puppet::Error', /The kombu_ssl_keyfile parameter requires rabbit_use_ssl to be set to true/ |
278 | 295 | end |
| 296 | + end |
| 297 | + |
| 298 | + end |
| 299 | + |
| 300 | + shared_examples_for 'with SSL and kombu wrongly configured' do |
| 301 | + before do |
| 302 | + params.merge!( |
| 303 | + :rabbit_use_ssl => true, |
| 304 | + :kombu_ssl_certfile => '/path/to/ssl/cert/file', |
| 305 | + :kombu_ssl_keyfile => '/path/to/ssl/keyfile' |
| 306 | + ) |
| 307 | + end |
| 308 | + |
| 309 | + context 'without required parameters' do |
279 | 310 |
|
280 | 311 | context 'without kombu_ssl_keyfile parameter' do |
281 | 312 | before { params.delete(:kombu_ssl_keyfile) } |
282 | | - it_raises 'a Puppet::Error', /The kombu_ssl_keyfile parameter is required when rabbit_use_ssl is set to true/ |
| 313 | + it_raises 'a Puppet::Error', /The kombu_ssl_certfile and kombu_ssl_keyfile parameters must be used together/ |
283 | 314 | end |
284 | 315 | end |
285 | 316 |
|
|
0 commit comments