2016-05-31 11:37:25 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'watcher::db::postgresql' do
|
|
|
|
|
|
|
|
let :pre_condition do
|
|
|
|
'include postgresql::server'
|
|
|
|
end
|
|
|
|
|
|
|
|
let :required_params do
|
2020-05-20 08:35:22 +09:00
|
|
|
{ :password => 'watcherpass' }
|
2016-05-31 11:37:25 +00:00
|
|
|
end
|
|
|
|
|
2022-07-24 01:03:32 +09:00
|
|
|
shared_examples_for 'watcher::db::postgresql' do
|
2016-05-31 11:37:25 +00:00
|
|
|
context 'with only required parameters' do
|
|
|
|
let :params do
|
|
|
|
required_params
|
|
|
|
end
|
|
|
|
|
2020-10-10 09:31:12 +08:00
|
|
|
it { is_expected.to contain_class('watcher::deps') }
|
|
|
|
|
2020-05-20 08:35:22 +09:00
|
|
|
it { is_expected.to contain_openstacklib__db__postgresql('watcher').with(
|
|
|
|
:user => 'watcher',
|
|
|
|
:password => 'watcherpass',
|
|
|
|
:dbname => 'watcher',
|
|
|
|
:encoding => nil,
|
|
|
|
:privileges => 'ALL',
|
2016-05-31 11:37:25 +00:00
|
|
|
)}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
on_supported_os({
|
|
|
|
:supported_os => OSDefaults.get_supported_os
|
|
|
|
}).each do |os,facts|
|
|
|
|
context "on #{os}" do
|
|
|
|
let (:facts) do
|
2022-07-24 01:03:32 +09:00
|
|
|
facts.merge!(OSDefaults.get_facts({
|
|
|
|
# puppet-postgresql requires the service_provider fact provided by
|
|
|
|
# puppetlabs-postgresql.
|
|
|
|
:service_provider => 'systemd'
|
|
|
|
}))
|
2016-05-31 11:37:25 +00:00
|
|
|
end
|
|
|
|
|
2022-07-24 01:03:32 +09:00
|
|
|
it_behaves_like 'watcher::db::postgresql'
|
2016-05-31 11:37:25 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|