Files
puppet-nova/spec/classes/nova_key_manager_barbican_spec.rb
Takashi Kajinami 123acbb302 Fix unit tests incompatible with puppetlab-stdlib 8.0.0
Since puppetlabs-stdlib 8.0.0, ensure_packages automatically translates
'ensure => present'  to 'ensure => installed' and that translation
breaks existing assertions in unit tests.

Change-Id: I394fc6112eb68a9f0decae275299f26e44812b44
2021-09-24 00:50:38 +09:00

68 lines
2.1 KiB
Ruby

require 'spec_helper'
describe 'nova::key_manager::barbican' do
shared_examples 'nova::key_manager::barbican' do
context 'with default parameters' do
it {
is_expected.to contain_oslo__key_manager__barbican('nova_config').with(
:barbican_endpoint => '<SERVICE DEFAULT>',
:barbican_api_version => '<SERVICE DEFAULT>',
:auth_endpoint => '<SERVICE DEFAULT>',
:retry_delay => '<SERVICE DEFAULT>',
:number_of_retries => '<SERVICE DEFAULT>',
:barbican_endpoint_type => '<SERVICE DEFAULT>',
:barbican_region_name => '<SERVICE DEFAULT>',
)
is_expected.to contain_package('cryptsetup').with(
:ensure => 'installed',
:tag => 'openstack',
)
}
end
context 'with specified parameters' do
let :params do
{
:barbican_endpoint => 'http://localhost:9311/',
:barbican_api_version => 'v1',
:auth_endpoint => 'http://localhost:5000',
:retry_delay => 1,
:number_of_retries => 60,
:barbican_endpoint_type => 'public',
:barbican_region_name => 'regionOne',
}
end
it {
is_expected.to contain_oslo__key_manager__barbican('nova_config').with(
:barbican_endpoint => 'http://localhost:9311/',
:barbican_api_version => 'v1',
:auth_endpoint => 'http://localhost:5000',
:retry_delay => 1,
:number_of_retries => 60,
:barbican_endpoint_type => 'public',
:barbican_region_name => 'regionOne',
)
is_expected.to contain_package('cryptsetup').with(
:ensure => 'installed',
:tag => 'openstack',
)
}
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 'nova::key_manager::barbican'
end
end
end