Files
puppet-nova/spec/classes/nova_db_sync_api_spec.rb
Alex Schultz 4234ce3df4 Add cell_v2 simple_cell_setup
As part of Ocata, nova has made the cell_v2 setup manditory for the
nova-api db sync process. This change adds a simple cell_v2 setup with a
cell0 and an execution of the 'nova-manage cell_v2 simple_cell_setup' as
part of the nova-api db setup and sync process.

Change-Id: Idfc369e9e17f7d5a30ce4ff52beb604dd4a6ac23
Closes-Bug: #1649341
2016-12-21 02:32:54 +00:00

58 lines
1.7 KiB
Ruby

require 'spec_helper'
describe 'nova::db::sync_api' do
shared_examples_for 'nova-dbsync-api' do
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') }
end
context "overriding extra_params" do
let :params do
{
:extra_params => '--config-file /etc/nova/nova.conf',
:cellv2_setup => true
}
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',
: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 contain_class('nova::db::sync_cell_v2') }
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 'nova-dbsync-api'
end
end
end