Files
puppet-mistral/spec/classes/mistral_db_sync_spec.rb
ZhongShengping f5078648ea Add 'openstack-db' tag to db-sync Exec resource
In order to make easy orchestration on all OpenStack db-sync, add this
tag so people can use this tag in composition layer.
A use case it to set some orchestration to make sure MySQL Galera is
ready before running any Exec with this tag.

Change-Id: I0769f75d92e87d686387286041502261fad871e7
Closes-Bug: #1755102
2018-03-12 16:33:09 +08:00

49 lines
1.2 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',
:try_sleep => 5,
:tries => 10,
:logoutput => 'on_failure',
:tag => 'openstack-db',
)
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',
:tag => 'openstack-db',
)
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({
:os_workers => 8,
:concat_basedir => '/var/lib/puppet/concat'
}))
end
it_configures 'mistral-db-sync'
end
end
end