2016-01-29 17:39:33 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'nova::db::sync_api' do
|
|
|
|
|
|
|
|
shared_examples_for 'nova-dbsync-api' do
|
2016-12-12 14:52:57 -07:00
|
|
|
context 'with defaults' do
|
|
|
|
it {
|
|
|
|
is_expected.to contain_exec('nova-db-sync-api').with(
|
|
|
|
:command => '/usr/bin/nova-manage api_db sync',
|
|
|
|
:refreshonly => 'true',
|
|
|
|
:logoutput => 'on_failure',
|
|
|
|
:subscribe => ['Anchor[nova::install::end]',
|
|
|
|
'Anchor[nova::config::end]',
|
|
|
|
'Anchor[nova::dbsync_api::begin]'],
|
|
|
|
:notify => 'Anchor[nova::dbsync_api::end]',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
it { is_expected.to_not contain_class('nova::db::sync_cell_v2') }
|
2016-01-29 17:39:33 -05:00
|
|
|
end
|
|
|
|
|
2016-12-12 14:52:57 -07:00
|
|
|
context "overriding extra_params" do
|
2016-01-29 17:39:33 -05:00
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:extra_params => '--config-file /etc/nova/nova.conf',
|
2016-12-12 14:52:57 -07:00
|
|
|
:cellv2_setup => true
|
2016-01-29 17:39:33 -05:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it {
|
|
|
|
is_expected.to contain_exec('nova-db-sync-api').with(
|
|
|
|
:command => '/usr/bin/nova-manage --config-file /etc/nova/nova.conf api_db sync',
|
|
|
|
:refreshonly => 'true',
|
2016-12-01 17:33:00 +08:00
|
|
|
:logoutput => 'on_failure',
|
|
|
|
:subscribe => ['Anchor[nova::install::end]',
|
|
|
|
'Anchor[nova::config::end]',
|
|
|
|
'Anchor[nova::dbsync_api::begin]'],
|
|
|
|
:notify => 'Anchor[nova::dbsync_api::end]',
|
2016-01-29 17:39:33 -05:00
|
|
|
)
|
2016-12-12 14:52:57 -07:00
|
|
|
}
|
|
|
|
it { is_expected.to contain_class('nova::db::sync_cell_v2') }
|
|
|
|
end
|
2016-01-29 17:39:33 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
2016-04-29 00:10:15 +08:00
|
|
|
on_supported_os({
|
|
|
|
:supported_os => OSDefaults.get_supported_os
|
|
|
|
}).each do |os,facts|
|
|
|
|
context "on #{os}" do
|
|
|
|
let (:facts) do
|
2016-12-12 14:52:57 -07:00
|
|
|
facts.merge(OSDefaults.get_facts())
|
2016-04-29 00:10:15 +08:00
|
|
|
end
|
2016-01-29 17:39:33 -05:00
|
|
|
|
2016-04-29 00:10:15 +08:00
|
|
|
it_configures 'nova-dbsync-api'
|
2016-01-29 17:39:33 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|