Files
puppet-mistral/spec/classes/mistral_db_sync_spec.rb
ZhongShengping c67c2017e1 Test multiple operating systems for db
This change updates the tests for mistral::db::postgresql and
mistral::db::sync to test multiple operating systems.

Change-Id: Ia362e005c253485db685880ddb5001a0cce5adef
2016-04-30 11:35:27 +08:00

45 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'mistral::db::sync' do
shared_examples_for 'mistral-db-sync' do
it 'runs mistral-db-manage upgrade head' do
is_expected.to contain_exec('mistral-db-sync').with(
:command => 'mistral-db-manage --config-file=/etc/mistral/mistral.conf upgrade head',
:path => '/usr/bin',
:user => 'mistral',
:refreshonly => 'true',
:logoutput => 'on_failure'
)
is_expected.to contain_exec('mistral-db-populate').with(
:command => 'mistral-db-manage --config-file=/etc/mistral/mistral.conf populate',
:path => '/usr/bin',
:user => 'mistral',
:refreshonly => 'true',
:logoutput => 'on_failure'
)
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({
:processorcount => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
it_configures 'mistral-db-sync'
end
end
end