| 1 | require 'spec_helper' |
| 2 | |
| 3 | describe 'magnum::healthcheck' do |
| 4 | |
| 5 | shared_examples_for 'magnum::healthcheck' do |
| 6 | |
| 7 | context 'with default parameters' do |
| 8 | let :params do |
| 9 | {} |
| 10 | end |
| 11 | |
| 12 | it 'configures default values' do |
| 13 | is_expected.to contain_oslo__healthcheck('magnum_config').with( |
| 14 | :detailed => '<SERVICE DEFAULT>', |
| 15 | :backends => '<SERVICE DEFAULT>', |
| 16 | :allowed_source_ranges => '<SERVICE DEFAULT>', |
| 17 | :ignore_proxied_requests => '<SERVICE DEFAULT>', |
| 18 | :disable_by_file_path => '<SERVICE DEFAULT>', |
| 19 | :disable_by_file_paths => '<SERVICE DEFAULT>', |
| 20 | :enable_by_file_paths => '<SERVICE DEFAULT>', |
| 21 | ) |
| 22 | end |
| 23 | end |
| 24 | |
| 25 | context 'with specific parameters' do |
| 26 | let :params do |
| 27 | { |
| 28 | :detailed => true, |
| 29 | :backends => ['disable_by_file'], |
| 30 | :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], |
| 31 | :ignore_proxied_requests => false, |
| 32 | :disable_by_file_path => '/etc/magnum/healthcheck/disabled', |
| 33 | :disable_by_file_paths => ['9511:/etc/magnum/healthcheck/disabled'], |
| 34 | :enable_by_file_paths => ['/etc/magnum/healthcheck/enabled'], |
| 35 | } |
| 36 | end |
| 37 | |
| 38 | it 'configures specified values' do |
| 39 | is_expected.to contain_oslo__healthcheck('magnum_config').with( |
| 40 | :detailed => true, |
| 41 | :backends => ['disable_by_file'], |
| 42 | :allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'], |
| 43 | :ignore_proxied_requests => false, |
| 44 | :disable_by_file_path => '/etc/magnum/healthcheck/disabled', |
| 45 | :disable_by_file_paths => ['9511:/etc/magnum/healthcheck/disabled'], |
| 46 | :enable_by_file_paths => ['/etc/magnum/healthcheck/enabled'], |
| 47 | ) |
| 48 | end |
| 49 | end |
| 50 | end |
| 51 | |
| 52 | on_supported_os({ |
| 53 | :supported_os => OSDefaults.get_supported_os |
| 54 | }).each do |os,facts| |
| 55 | context "on #{os}" do |
| 56 | let (:facts) do |
| 57 | facts.merge!(OSDefaults.get_facts()) |
| 58 | end |
| 59 | |
| 60 | it_configures 'magnum::healthcheck' |
| 61 | end |
| 62 | end |
| 63 | |
| 64 | end |