puppet-trove/spec/classes/trove_db_sync_spec.rb
Takashi Kajinami 505c5dbbe4 Replace legacy facts and use fact hash
... because the latest lint no longer allows usage of legacy facts and
top scope fact.

This also fixes the wrong wsgi script name introduced by [1] to fix
broken litmus jobs.

[1] d7a1ea5fb7

Change-Id: Idb7d655242ccd6f785ea4dfbb94d8ff3ad961b03
2023-03-02 13:53:25 +09:00

44 lines
1.1 KiB
Ruby

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