puppet-mistral/spec/classes/mistral_db_sync_spec.rb
Dan Prince 16a00799a9 Update mistral::db::sync to run 'update head'
This patch modifies mistral::db::sync so that it
runs 'update head' in addition to 'populate'.

This brings the mistral "db_sync" class more inline
with other Puppet Openstack modules that run DB sync
and fixes issues in bootstrapping mistral in that
running populate without first having an 'upgrade head'
would always fail. Both actions appear to be idempotent
so re-running them should be fine.

Change-Id: I13f037c3eea944d5f41ced904623e38ce3fcae44
2015-12-09 10:28:50 -05:00

54 lines
1.3 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
context 'on a RedHat osfamily' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
}
end
it_configures 'mistral-db-sync'
end
context 'on a Debian osfamily' do
let :facts do
{
:operatingsystemrelease => '8.0',
:osfamily => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
}
end
it_configures 'mistral-db-sync'
end
end