puppet-heat/spec/defines/heat_clients_base_spec.rb
Takashi Kajinami 0d043d793f Support more clients configurations
This change introduces support for [clients] parameters and
[clients_<service>] parameters, which determine behavior of service
clients used by heat for communication with the OpenStack services.

- Implementation of heat::clients::<service> are generally same.
  Only cinder, heat, keystone and nova provides additional parameters.

- The existing parameters in the base heat class are deprecated in
  favor of the new classes.

Change-Id: Icdf4f0201dd1e5f93a450473709851977ec20034
2022-04-03 23:22:26 +09:00

52 lines
1.8 KiB
Ruby

require 'spec_helper'
describe 'heat::clients::base' do
let (:title) do
'clients_foo'
end
shared_examples 'heat::clients::base' do
context 'with defaults' do
it 'configures defaults' do
is_expected.to contain_heat_config('clients_foo/endpoint_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_heat_config('clients_foo/ca_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_heat_config('clients_foo/cert_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_heat_config('clients_foo/key_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_heat_config('clients_foo/insecure').with_value('<SERVICE DEFAULT>')
end
end
context 'with parameters' do
let :params do
{
:endpoint_type => 'publicURL',
:ca_file => '/path/to/ca.cert',
:cert_file => '/path/to/certfile',
:key_file => '/path/to/key',
:insecure => false,
}
end
it 'configures defaults' do
is_expected.to contain_heat_config('clients_foo/endpoint_type').with_value('publicURL')
is_expected.to contain_heat_config('clients_foo/ca_file').with_value('/path/to/ca.cert')
is_expected.to contain_heat_config('clients_foo/cert_file').with_value('/path/to/certfile')
is_expected.to contain_heat_config('clients_foo/key_file').with_value('/path/to/key')
is_expected.to contain_heat_config('clients_foo/insecure').with_value(false)
end
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'heat::clients::base'
end
end
end