| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'nova::db::postgresql' do |
| 4 |
|
| 5 |
shared_examples 'nova::db::postgresql' do |
| 6 |
let :req_params do |
| 7 |
{ :password => 'pw' } |
| 8 |
end |
| 9 |
|
| 10 |
let :pre_condition do |
| 11 |
'include postgresql::server' |
| 12 |
end |
| 13 |
|
| 14 |
context 'with only required parameters' do |
| 15 |
let :params do |
| 16 |
req_params |
| 17 |
end |
| 18 |
|
| 19 |
it { is_expected.to contain_class('nova::deps') } |
| 20 |
|
| 21 |
it { should contain_openstacklib__db__postgresql('nova').with( |
| 22 |
:password => 'pw', |
| 23 |
:dbname => 'nova', |
| 24 |
:user => 'nova', |
| 25 |
:encoding => nil, |
| 26 |
:privileges => 'ALL', |
| 27 |
)} |
| 28 |
|
| 29 |
it { should contain_openstacklib__db__postgresql('nova_cell0').with( |
| 30 |
:password => 'pw', |
| 31 |
:dbname => 'nova_cell0', |
| 32 |
:user => 'nova', |
| 33 |
:encoding => nil, |
| 34 |
:privileges => 'ALL', |
| 35 |
)} |
| 36 |
end |
| 37 |
|
| 38 |
context 'when disabling cell0 setup' do |
| 39 |
let :params do |
| 40 |
{ :setup_cell0 => false}.merge(req_params) |
| 41 |
end |
| 42 |
|
| 43 |
it { is_expected.to_not contain_openstacklib__db__postgresql('nova_cell0') } |
| 44 |
end |
| 45 |
end |
| 46 |
|
| 47 |
on_supported_os({ |
| 48 |
:supported_os => OSDefaults.get_supported_os |
| 49 |
}).each do |os,facts| |
| 50 |
context "on #{os}" do |
| 51 |
let (:facts) do |
| 52 |
facts.merge(OSDefaults.get_facts({ |
| 53 |
# puppet-postgresql requires the service_provider fact provided by |
| 54 |
# puppetlabs-postgresql. |
| 55 |
:service_provider => 'systemd' |
| 56 |
})) |
| 57 |
end |
| 58 |
|
| 59 |
it_configures 'nova::db::postgresql' |
| 60 |
end |
| 61 |
end |
| 62 |
|
| 63 |
end |