Files
puppet-vitrage/spec/classes/vitrage_db_sync_spec.rb
Takashi Kajinami a2b5f54ff2 Replace legacy facts and use fact hash
... because the latest lint no longer allows usage of legacy facts and
top scope fact.

Change-Id: I074f444198722984c5499f0a222148a46ce02612
2023-03-02 12:43:23 +09:00

69 lines
1.9 KiB
Ruby

require 'spec_helper'
describe 'vitrage::db::sync' do
shared_examples_for 'vitrage-dbsync' do
it { is_expected.to contain_class('vitrage::deps') }
it 'runs vitrage-manage db sync' do
is_expected.to contain_exec('vitrage-db-sync').with(
:command => 'vitrage-dbsync ',
:user => 'vitrage',
:path => '/usr/bin',
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:timeout => 300,
:logoutput => 'on_failure',
:subscribe => ['Anchor[vitrage::install::end]',
'Anchor[vitrage::config::end]',
'Anchor[vitrage::dbsync::begin]'],
:notify => 'Anchor[vitrage::dbsync::end]',
:tag => 'openstack-db',
)
end
describe "overriding extra_params" do
let :params do
{
:extra_params => '--config-file /etc/vitrage/vitrage.conf',
:db_sync_timeout => 750,
}
end
it {
is_expected.to contain_exec('vitrage-db-sync').with(
:command => 'vitrage-dbsync --config-file /etc/vitrage/vitrage.conf',
:user => 'vitrage',
:path => '/usr/bin',
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:timeout => 750,
:logoutput => 'on_failure',
:subscribe => ['Anchor[vitrage::install::end]',
'Anchor[vitrage::config::end]',
'Anchor[vitrage::dbsync::begin]'],
:notify => 'Anchor[vitrage::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 'vitrage-dbsync'
end
end
end