Test multiple operating systems for db

This change updates the tests for ceilometer::db::postgresql and
ceilometer::db::sync to test multiple operating systems.

Change-Id: Ia3776f80bbd37981725668a55a76ecd4f20389c0
changes/81/311481/3
ZhongShengping 7 years ago
parent e3c649f087
commit ba21901512
  1. 48
      spec/classes/ceilometer_db_postgresql_spec.rb
  2. 33
      spec/classes/ceilometer_db_sync_spec.rb

@ -2,21 +2,13 @@ require 'spec_helper'
describe 'ceilometer::db::postgresql' do
let :req_params do
{ :password => 'pw' }
end
let :pre_condition do
'include postgresql::server'
end
shared_examples_for 'ceilometer::db::postgresql' do
let :req_params do
{ :password => 'pw' }
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
})
let :pre_condition do
'include postgresql::server'
end
context 'with only required parameters' do
@ -32,27 +24,19 @@ describe 'ceilometer::db::postgresql' do
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({
:operatingsystemrelease => '7.8',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
})
end
context 'with only required parameters' do
let :params do
req_params
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({
:processorcount => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
it { is_expected.to contain_postgresql__server__db('ceilometer').with(
:user => 'ceilometer',
:password => 'md52899c518e96bce6633ab342b0ca38292'
)}
it_configures 'ceilometer::db::postgresql'
end
end
end

@ -33,30 +33,19 @@ describe 'ceilometer::db::sync' do
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({
:processorcount => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
})
end
it_configures 'ceilometer-dbsync'
end
context 'on a Debian osfamily' do
let :facts do
{
:operatingsystemrelease => '7.8',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
}
it_configures 'ceilometer-dbsync'
end
it_configures 'ceilometer-dbsync'
end
end

Loading…
Cancel
Save