Files
puppet-nova/spec/classes/nova_db_sync_cell_v2_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

63 lines
1.9 KiB
Ruby

require 'spec_helper'
describe 'nova::db::sync_cell_v2' do
shared_examples_for 'nova-db-sync-cell_v2' do
context 'with defaults' do
it {
is_expected.to contain_exec('nova-cell_v2-simple-cell-setup').with(
:command => '/usr/bin/nova-manage cell_v2 simple_cell_setup ',
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::dbsync_api::end]',
'Anchor[nova::cell_v2::begin]'],
:notify => 'Anchor[nova::cell_v2::end]',
)
}
end
context "overriding extra_params" do
let :params do
{
:extra_params => '--config-file /etc/nova/nova.conf',
:transport_url => 'rabbit://user:pass@host:1234/virt'
}
end
it {
is_expected.to contain_exec('nova-cell_v2-simple-cell-setup').with(
:command => '/usr/bin/nova-manage --config-file /etc/nova/nova.conf cell_v2 simple_cell_setup --transport-url=rabbit://user:pass@host:1234/virt',
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:logoutput => 'on_failure',
:subscribe => ['Anchor[nova::install::end]',
'Anchor[nova::config::end]',
'Anchor[nova::dbsync_api::end]',
'Anchor[nova::cell_v2::begin]'],
:notify => 'Anchor[nova::cell_v2::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())
end
it_configures 'nova-db-sync-cell_v2'
end
end
end