| 1 | require 'spec_helper' |
| 2 | |
| 3 | describe 'magnum::clients::neutron' do |
| 4 | |
| 5 | shared_examples 'magnum::clients::neutron' do |
| 6 | |
| 7 | context 'with default parameters' do |
| 8 | let :params do |
| 9 | {} |
| 10 | end |
| 11 | |
| 12 | it { is_expected.to contain_magnum_config('neutron_client/region_name').with_value('RegionOne') } |
| 13 | it { is_expected.to contain_magnum_config('neutron_client/endpoint_type').with_value('<SERVICE DEFAULT>') } |
| 14 | it { is_expected.to contain_magnum_config('neutron_client/ca_file').with_value('<SERVICE DEFAULT>') } |
| 15 | it { is_expected.to contain_magnum_config('neutron_client/cert_file').with_value('<SERVICE DEFAULT>') } |
| 16 | it { is_expected.to contain_magnum_config('neutron_client/key_file').with_value('<SERVICE DEFAULT>') } |
| 17 | it { is_expected.to contain_magnum_config('neutron_client/insecure').with_value('<SERVICE DEFAULT>') } |
| 18 | end |
| 19 | |
| 20 | context 'with specific parameters' do |
| 21 | let :params do |
| 22 | { :region_name => 'RegionTwo', |
| 23 | :endpoint_type => 'adminURL', |
| 24 | :ca_file => '/etc/magnum/certs/ca.pem', |
| 25 | :cert_file => '/etc/magnum/certs/cert.pem', |
| 26 | :key_file => '/etc/magnum/certs/pri.key', |
| 27 | :insecure => true, |
| 28 | |
| 29 | } |
| 30 | end |
| 31 | |
| 32 | it { is_expected.to contain_magnum_config('neutron_client/region_name').with_value('RegionTwo') } |
| 33 | it { is_expected.to contain_magnum_config('neutron_client/endpoint_type').with_value('adminURL') } |
| 34 | it { is_expected.to contain_magnum_config('neutron_client/ca_file').with_value('/etc/magnum/certs/ca.pem') } |
| 35 | it { is_expected.to contain_magnum_config('neutron_client/cert_file').with_value('/etc/magnum/certs/cert.pem') } |
| 36 | it { is_expected.to contain_magnum_config('neutron_client/key_file').with_value('/etc/magnum/certs/pri.key') } |
| 37 | it { is_expected.to contain_magnum_config('neutron_client/insecure').with_value(true) } |
| 38 | end |
| 39 | end |
| 40 | |
| 41 | on_supported_os({ |
| 42 | :supported_os => OSDefaults.get_supported_os |
| 43 | }).each do |os,facts| |
| 44 | context "on #{os}" do |
| 45 | let (:facts) do |
| 46 | facts.merge!(OSDefaults.get_facts()) |
| 47 | end |
| 48 | |
| 49 | it_configures 'magnum::clients::neutron' |
| 50 | end |
| 51 | end |
| 52 | end |