Test multiple operating systems for db

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

Change-Id: Ifcde1fc25f8111655a1f50ac1e30b1d52bb3b1ce
This commit is contained in:
ZhongShengping 2016-04-30 11:45:04 +08:00
parent a0f957f2e8
commit 56d2a46738
2 changed files with 30 additions and 56 deletions

View File

@ -2,6 +2,7 @@ require 'spec_helper'
describe 'neutron::db::postgresql' do describe 'neutron::db::postgresql' do
shared_examples_for 'neutron::db::postgresql' do
let :req_params do let :req_params do
{ :password => 'pw' } { :password => 'pw' }
end end
@ -16,15 +17,6 @@ describe 'neutron::db::postgresql' do
} }
end end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge(test_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
}))
end
context 'with only required parameters' do context 'with only required parameters' do
let :params do let :params do
req_params req_params
@ -38,27 +30,19 @@ describe 'neutron::db::postgresql' do
end end
context 'on a Debian osfamily' do on_supported_os({
let :facts do :supported_os => OSDefaults.get_supported_os
@default_facts.merge(test_facts.merge({ }).each do |os,facts|
:operatingsystemrelease => '7.8', context "on #{os}" do
:operatingsystem => 'Debian', let (:facts) do
:osfamily => 'Debian', facts.merge(OSDefaults.get_facts({
:processorcount => 8,
:concat_basedir => '/var/lib/puppet/concat' :concat_basedir => '/var/lib/puppet/concat'
})) }))
end end
context 'with only required parameters' do it_configures 'neutron::db::postgresql'
let :params do
req_params
end end
it { is_expected.to contain_postgresql__server__db('neutron').with(
:user => 'neutron',
:password => 'md5696acd1dd66513a556a18a1beccd03d1'
)}
end
end end
end end

View File

@ -32,29 +32,19 @@ describe 'neutron::db::sync' do
end end
context 'on a RedHat osfamily' do on_supported_os({
let :facts do :supported_os => OSDefaults.get_supported_os
{ }).each do |os,facts|
:osfamily => 'RedHat', context "on #{os}" do
:operatingsystemrelease => '7.0', let (:facts) do
facts.merge(OSDefaults.get_facts({
:processorcount => 8,
:concat_basedir => '/var/lib/puppet/concat' :concat_basedir => '/var/lib/puppet/concat'
} }))
end end
it_configures 'neutron-dbsync' it_configures 'neutron-dbsync'
end end
context 'on a Debian osfamily' do
let :facts do
{
:operatingsystemrelease => '7.8',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
}
end
it_configures 'neutron-dbsync'
end end
end end