puppet-nova/spec/classes/nova_db_postgresql_spec.rb
Tobias Urdin 9171b9b8b7 Add cell0 database creation in postgresql
Add cell0 database creation like stx patched in [1].
Also fixes an faulty comment in the same resource for mysql.

[1]
https://git.starlingx.io/cgit/stx-integ/tree/config/puppet-modules/openstack/puppet-nova-11.4.0/centos/patches/0003-Create-nova_cell0-database.patch

Change-Id: I4183ed4417c9beeccf8b7355ac217088302d0160
2018-11-19 13:54:54 +01:00

61 lines
1.5 KiB
Ruby

require 'spec_helper'
describe 'nova::db::postgresql' do
shared_examples 'nova::db::postgresql' do
let :req_params do
{ :password => 'pw' }
end
let :pre_condition do
'include postgresql::server'
end
context 'with only required parameters' do
let :params do
req_params
end
it { should contain_openstacklib__db__postgresql('nova').with(
:password_hash => 'md557ae0608fad632bf0155cb9502a6b454',
:dbname => 'nova',
:user => 'nova',
:encoding => nil,
:privileges => 'ALL',
)}
it { should contain_openstacklib__db__postgresql('nova_cell0').with(
:password_hash => 'md557ae0608fad632bf0155cb9502a6b454',
:dbname => 'nova_cell0',
:user => 'nova',
:encoding => nil,
:privileges => 'ALL',
)}
end
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
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({
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
it_configures 'nova::db::postgresql'
end
end
end