07a7b66bae
Since it's possible to run glance-api without glance-registry, we shouldn't be passing the registry config file in every database sync. This patch keeps the extra_param so that we can pass the config file if the registry is enabled from other places. Depends-On: Ib9f511219e8cb9a7322745b6bd7c4f9c9cc0c198 Change-Id: I4e7570bdc1b8d89c9914855fd8eec13688fbf9f3
60 lines
1.7 KiB
Ruby
60 lines
1.7 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe 'glance::db::sync' do
|
|
|
|
shared_examples_for 'glance-dbsync' do
|
|
|
|
it 'runs glance-manage db_sync' do
|
|
is_expected.to contain_exec('glance-manage db_sync').with(
|
|
:command => 'glance-manage db_sync',
|
|
:path => '/usr/bin',
|
|
:user => 'glance',
|
|
:refreshonly => 'true',
|
|
:try_sleep => 5,
|
|
:tries => 10,
|
|
:logoutput => 'on_failure',
|
|
:subscribe => ['Anchor[glance::install::end]',
|
|
'Anchor[glance::config::end]',
|
|
'Anchor[glance::dbsync::begin]'],
|
|
:notify => 'Anchor[glance::dbsync::end]',
|
|
)
|
|
end
|
|
|
|
describe "overriding extra_params" do
|
|
let :params do
|
|
{
|
|
:extra_params => '--config-file /etc/glance/glance.conf',
|
|
}
|
|
end
|
|
|
|
it {is_expected.to contain_exec('glance-manage db_sync').with(
|
|
:command => 'glance-manage --config-file /etc/glance/glance.conf db_sync',
|
|
:path => '/usr/bin',
|
|
:user => 'glance',
|
|
:refreshonly => 'true',
|
|
:try_sleep => 5,
|
|
:tries => 10,
|
|
:logoutput => 'on_failure',
|
|
:subscribe => ['Anchor[glance::install::end]',
|
|
'Anchor[glance::config::end]',
|
|
'Anchor[glance::dbsync::begin]'],
|
|
:notify => 'Anchor[glance::dbsync::end]',
|
|
)
|
|
}
|
|
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({ :concat_basedir => '/var/lib/puppet/concat' }))
|
|
end
|
|
|
|
it_configures 'glance-dbsync'
|
|
end
|
|
end
|
|
|
|
end
|