2013-04-23 12:03:38 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'cinder::db::postgresql' do
|
2018-11-04 22:52:43 +01:00
|
|
|
shared_examples 'cinder::db::postgresql' do
|
2016-04-30 09:59:07 +08:00
|
|
|
let :req_params do
|
2020-05-19 19:39:53 +09:00
|
|
|
{ :password => 'cinderpass' }
|
2016-04-30 09:59:07 +08:00
|
|
|
end
|
2013-04-23 12:03:38 -04:00
|
|
|
|
2016-04-30 09:59:07 +08:00
|
|
|
let :pre_condition do
|
|
|
|
'include postgresql::server'
|
2013-04-23 12:03:38 -04:00
|
|
|
end
|
2014-12-30 18:00:58 +01:00
|
|
|
|
|
|
|
context 'with only required parameters' do
|
|
|
|
let :params do
|
|
|
|
req_params
|
|
|
|
end
|
|
|
|
|
2020-10-10 09:31:12 +08:00
|
|
|
it { is_expected.to contain_class('cinder::deps') }
|
|
|
|
|
2020-05-19 19:39:53 +09:00
|
|
|
it { is_expected.to contain_openstacklib__db__postgresql('cinder').with(
|
|
|
|
:user => 'cinder',
|
|
|
|
:password => 'cinderpass',
|
|
|
|
:dbname => 'cinder',
|
|
|
|
:encoding => nil,
|
|
|
|
:privileges => 'ALL',
|
2014-12-30 18:00:58 +01:00
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-04-30 09:59:07 +08:00
|
|
|
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({
|
2016-10-04 20:33:40 +03:00
|
|
|
:os_workers => 8,
|
2016-04-30 09:59:07 +08:00
|
|
|
:concat_basedir => '/var/lib/puppet/concat'
|
|
|
|
}))
|
2014-12-30 18:00:58 +01:00
|
|
|
end
|
|
|
|
|
2022-02-16 00:01:44 +09:00
|
|
|
# TODO(tkajinam): Remove this once puppet-postgresql supports CentOS 9
|
|
|
|
unless facts[:osfamily] == 'RedHat' and facts[:operatingsystemmajrelease].to_i >= 9
|
|
|
|
it_behaves_like 'cinder::db::postgresql'
|
|
|
|
end
|
2014-12-30 18:00:58 +01:00
|
|
|
end
|
2013-04-23 12:03:38 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|