2015-06-29 13:12:27 +02:00
|
|
|
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(
|
2015-11-19 16:31:13 +00:00
|
|
|
:command => 'glance-manage --config-file /etc/glance/glance-registry.conf db_sync',
|
2015-06-29 13:12:27 +02:00
|
|
|
:path => '/usr/bin',
|
|
|
|
:user => 'glance',
|
|
|
|
:refreshonly => 'true',
|
|
|
|
:logoutput => 'on_failure'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2015-11-02 22:04:35 +00:00
|
|
|
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',
|
|
|
|
:logoutput => 'on_failure'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2015-06-29 13:12:27 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'on a RedHat osfamily' do
|
|
|
|
let :facts do
|
2015-10-21 12:54:54 +03:00
|
|
|
@default_facts.merge({
|
2015-06-29 13:12:27 +02:00
|
|
|
:osfamily => 'RedHat',
|
|
|
|
:operatingsystemrelease => '7.0',
|
|
|
|
:concat_basedir => '/var/lib/puppet/concat'
|
2015-10-21 12:54:54 +03:00
|
|
|
})
|
2015-06-29 13:12:27 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'glance-dbsync'
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'on a Debian osfamily' do
|
|
|
|
let :facts do
|
2015-10-21 12:54:54 +03:00
|
|
|
@default_facts.merge({
|
2015-06-29 13:12:27 +02:00
|
|
|
:operatingsystemrelease => '7.8',
|
|
|
|
:operatingsystem => 'Debian',
|
|
|
|
:osfamily => 'Debian',
|
|
|
|
:concat_basedir => '/var/lib/puppet/concat'
|
2015-10-21 12:54:54 +03:00
|
|
|
})
|
2015-06-29 13:12:27 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
it_configures 'glance-dbsync'
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|