puppet-magnum/spec/classes/magnum_certificates_spec.rb
Takashi Kajinami f542429fe9 Add support for [certificates] storage_path option
... and also add unit test coverage of the certificates class.

Change-Id: Ice02e476895408a9373741b7395f28771e7109ad
2024-05-07 00:31:49 +09:00

39 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'magnum::certificates' do
shared_examples 'magnum::certificates' do
it 'contains default values' do
is_expected.to contain_magnum_config('certificates/cert_manager_type').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('certificates/storage_path').with_value('<SERVICE DEFAULT>')
end
context 'configure certificates with parameters' do
let :params do
{
:cert_manager_type => 'barbican',
:storage_path => '/var/lib/magnum/certificates/',
}
end
it 'contains overridden values' do
is_expected.to contain_magnum_config('certificates/cert_manager_type').with_value('barbican')
is_expected.to contain_magnum_config('certificates/storage_path').with_value('/var/lib/magnum/certificates/')
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 'magnum::certificates'
end
end
end