puppet-mistral/spec/classes/mistral_db_sync_spec.rb
Takashi Kajinami 572fb50018 Stop hard-coding config file for db sync
The mistral-db-manage command by default loads
/etc/mistral/mistral.conf. Removing the override allows us to use
additional paths such as mistral.conf.d in the future.

Change-Id: Ia7e988df093e16dd6ad53ce2d2f8e6b340daf887
2024-03-05 12:34:29 +09:00

58 lines
1.6 KiB
Ruby

require 'spec_helper'
describe 'mistral::db::sync' do
shared_examples_for 'mistral-db-sync' do
it { is_expected.to contain_class('mistral::deps') }
it 'runs mistral-db-manage upgrade head' do
is_expected.to contain_exec('mistral-db-sync').with(
:command => 'mistral-db-manage upgrade head',
:path => '/usr/bin',
:user => 'mistral',
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:timeout => 300,
:logoutput => 'on_failure',
:subscribe => ['Anchor[mistral::install::end]',
'Anchor[mistral::config::end]',
'Anchor[mistral::dbsync::begin]'],
:notify => 'Anchor[mistral::dbsync::end]',
:tag => 'openstack-db',
)
is_expected.to contain_exec('mistral-db-populate').with(
:command => 'mistral-db-manage populate',
:path => '/usr/bin',
:user => 'mistral',
:refreshonly => 'true',
:timeout => 300,
:logoutput => 'on_failure',
:subscribe => ['Anchor[mistral::install::end]',
'Anchor[mistral::config::end]',
'Anchor[mistral::dbsync::begin]'],
:notify => 'Anchor[mistral::dbsync::end]',
: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())
end
it_configures 'mistral-db-sync'
end
end
end