|
459 | 459 | end |
460 | 460 | end |
461 | 461 |
|
| 462 | + describe 'interfaces option with no ssl' do |
| 463 | + let(:params) { |
| 464 | + { :interface => '0.0.0.0', |
| 465 | + } } |
| 466 | + |
| 467 | + it 'should set ssl options to specified values' do |
| 468 | + should contain_file('rabbitmq.config').with_content(%r{tcp_listeners, \[\{"0.0.0.0", 5672\}\]}) |
| 469 | + end |
| 470 | + end |
| 471 | + |
462 | 472 | describe 'ssl options' do |
463 | 473 | let(:params) { |
464 | 474 | { :ssl => true, |
|
484 | 494 | end |
485 | 495 | end |
486 | 496 |
|
| 497 | + |
| 498 | + describe 'ssl options with ssl_interfaces' do |
| 499 | + let(:params) { |
| 500 | + { :ssl => true, |
| 501 | + :ssl_port => 3141, |
| 502 | + :ssl_interface => '0.0.0.0', |
| 503 | + :ssl_cacert => '/path/to/cacert', |
| 504 | + :ssl_cert => '/path/to/cert', |
| 505 | + :ssl_key => '/path/to/key' |
| 506 | + } } |
| 507 | + |
| 508 | + it 'should set ssl options to specified values' do |
| 509 | + should contain_file('rabbitmq.config').with_content(%r{ssl_listeners, \[\{"0.0.0.0", 3141\}\]}) |
| 510 | + should contain_file('rabbitmq.config').with_content(%r{ssl_options, \[\{cacertfile,"/path/to/cacert"}) |
| 511 | + should contain_file('rabbitmq.config').with_content(%r{certfile,"/path/to/cert"}) |
| 512 | + should contain_file('rabbitmq.config').with_content(%r{keyfile,"/path/to/key}) |
| 513 | + end |
| 514 | + end |
| 515 | + |
| 516 | + |
| 517 | + |
487 | 518 | describe 'ssl options with ssl_only' do |
488 | 519 | let(:params) { |
489 | 520 | { :ssl => true, |
|
503 | 534 | end |
504 | 535 | end |
505 | 536 |
|
| 537 | + describe 'ssl options with ssl_only and ssl_interfaces' do |
| 538 | + let(:params) { |
| 539 | + { :ssl => true, |
| 540 | + :ssl_only => true, |
| 541 | + :ssl_port => 3141, |
| 542 | + :ssl_interface => '0.0.0.0', |
| 543 | + :ssl_cacert => '/path/to/cacert', |
| 544 | + :ssl_cert => '/path/to/cert', |
| 545 | + :ssl_key => '/path/to/key' |
| 546 | + } } |
| 547 | + |
| 548 | + it 'should set ssl options to specified values' do |
| 549 | + should contain_file('rabbitmq.config').with_content(%r{tcp_listeners, \[\]}) |
| 550 | + should contain_file('rabbitmq.config').with_content(%r{ssl_listeners, \[\{"0.0.0.0", 3141\}\]}) |
| 551 | + should contain_file('rabbitmq.config').with_content(%r{ssl_options, \[\{cacertfile,"/path/to/cacert"}) |
| 552 | + should contain_file('rabbitmq.config').with_content(%r{certfile,"/path/to/cert"}) |
| 553 | + should contain_file('rabbitmq.config').with_content(%r{keyfile,"/path/to/key}) |
| 554 | + end |
| 555 | + end |
| 556 | + |
506 | 557 | describe 'ssl options with specific ssl versions' do |
507 | 558 | let(:params) { |
508 | 559 | { :ssl => true, |
|
0 commit comments