2013-04-23 11:46:08 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'nova::db::postgresql' do
|
2014-12-30 22:19:33 +01:00
|
|
|
|
2018-11-19 13:54:54 +01:00
|
|
|
shared_examples 'nova::db::postgresql' do
|
2016-04-30 11:49:23 +08:00
|
|
|
let :req_params do
|
|
|
|
{ :password => 'pw' }
|
|
|
|
end
|
2013-04-23 11:46:08 -04:00
|
|
|
|
2016-04-30 11:49:23 +08:00
|
|
|
let :pre_condition do
|
|
|
|
'include postgresql::server'
|
2013-04-23 11:46:08 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'with only required parameters' do
|
|
|
|
let :params do
|
2014-12-30 22:19:33 +01:00
|
|
|
req_params
|
2013-04-23 11:46:08 -04:00
|
|
|
end
|
|
|
|
|
2020-10-10 09:31:12 +08:00
|
|
|
it { is_expected.to contain_class('nova::deps') }
|
|
|
|
|
2018-11-19 13:54:54 +01:00
|
|
|
it { should contain_openstacklib__db__postgresql('nova').with(
|
2020-05-17 09:21:48 +09:00
|
|
|
:password => 'pw',
|
|
|
|
:dbname => 'nova',
|
|
|
|
:user => 'nova',
|
|
|
|
:encoding => nil,
|
|
|
|
:privileges => 'ALL',
|
2018-11-19 13:54:54 +01:00
|
|
|
)}
|
|
|
|
|
|
|
|
it { should contain_openstacklib__db__postgresql('nova_cell0').with(
|
2020-05-17 09:21:48 +09:00
|
|
|
:password => 'pw',
|
|
|
|
:dbname => 'nova_cell0',
|
|
|
|
:user => 'nova',
|
|
|
|
:encoding => nil,
|
|
|
|
:privileges => 'ALL',
|
2013-04-23 11:46:08 -04:00
|
|
|
)}
|
|
|
|
end
|
|
|
|
|
2018-11-19 13:54:54 +01:00
|
|
|
context 'when disabling cell0 setup' do
|
|
|
|
let :params do
|
|
|
|
{ :setup_cell0 => false}.merge(req_params)
|
|
|
|
end
|
|
|
|
|
|
|
|
it { is_expected.to_not contain_openstacklib__db__postgresql('nova_cell0') }
|
|
|
|
end
|
2013-04-23 11:46:08 -04:00
|
|
|
end
|
|
|
|
|
2016-04-30 11:49:23 +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({
|
2022-07-24 00:51:10 +09:00
|
|
|
# puppet-postgresql requires the service_provider fact provided by
|
|
|
|
# puppetlabs-postgresql.
|
|
|
|
:service_provider => 'systemd'
|
2016-04-30 11:49:23 +08:00
|
|
|
}))
|
2013-04-23 11:46:08 -04:00
|
|
|
end
|
|
|
|
|
2022-07-24 00:51:10 +09:00
|
|
|
it_configures 'nova::db::postgresql'
|
2013-04-23 11:46:08 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|