| 1 |
require 'spec_helper' |
| 2 |
|
| 3 |
describe 'nova::db::online_data_migrations' do |
| 4 |
|
| 5 |
shared_examples_for 'nova-db-online-data-migrations' do |
| 6 |
|
| 7 |
it 'runs nova-db-sync' do |
| 8 |
is_expected.to contain_exec('nova-db-online-data-migrations').with( |
| 9 |
:command => '/usr/bin/nova-manage db online_data_migrations', |
| 10 |
:user => 'nova', |
| 11 |
:refreshonly => 'true', |
| 12 |
:try_sleep => 5, |
| 13 |
:tries => 10, |
| 14 |
:timeout => 300, |
| 15 |
:logoutput => 'on_failure', |
| 16 |
:subscribe => ['Anchor[nova::install::end]', |
| 17 |
'Anchor[nova::config::end]', |
| 18 |
'Anchor[nova::db_online_data_migrations::begin]'], |
| 19 |
:notify => 'Anchor[nova::db_online_data_migrations::end]', |
| 20 |
) |
| 21 |
end |
| 22 |
|
| 23 |
describe "overriding extra_params" do |
| 24 |
let :params do |
| 25 |
{ |
| 26 |
:extra_params => '--config-file /etc/nova/nova.conf', |
| 27 |
} |
| 28 |
end |
| 29 |
|
| 30 |
it { |
| 31 |
is_expected.to contain_exec('nova-db-online-data-migrations').with( |
| 32 |
:command => '/usr/bin/nova-manage --config-file /etc/nova/nova.conf db online_data_migrations', |
| 33 |
:user => 'nova', |
| 34 |
:refreshonly => 'true', |
| 35 |
:try_sleep => 5, |
| 36 |
:tries => 10, |
| 37 |
:timeout => 300, |
| 38 |
:logoutput => 'on_failure', |
| 39 |
:subscribe => ['Anchor[nova::install::end]', |
| 40 |
'Anchor[nova::config::end]', |
| 41 |
'Anchor[nova::db_online_data_migrations::begin]'], |
| 42 |
:notify => 'Anchor[nova::db_online_data_migrations::end]', |
| 43 |
) |
| 44 |
} |
| 45 |
end |
| 46 |
|
| 47 |
describe "overriding db_sync_timeout" do |
| 48 |
let :params do |
| 49 |
{ |
| 50 |
:db_sync_timeout => 750, |
| 51 |
} |
| 52 |
end |
| 53 |
|
| 54 |
it { |
| 55 |
is_expected.to contain_exec('nova-db-online-data-migrations').with( |
| 56 |
:command => '/usr/bin/nova-manage db online_data_migrations', |
| 57 |
:user => 'nova', |
| 58 |
:refreshonly => 'true', |
| 59 |
:try_sleep => 5, |
| 60 |
:tries => 10, |
| 61 |
:timeout => 750, |
| 62 |
:logoutput => 'on_failure', |
| 63 |
:subscribe => ['Anchor[nova::install::end]', |
| 64 |
'Anchor[nova::config::end]', |
| 65 |
'Anchor[nova::db_online_data_migrations::begin]'], |
| 66 |
:notify => 'Anchor[nova::db_online_data_migrations::end]', |
| 67 |
) |
| 68 |
} |
| 69 |
end |
| 70 |
|
| 71 |
end |
| 72 |
|
| 73 |
|
| 74 |
on_supported_os({ |
| 75 |
:supported_os => OSDefaults.get_supported_os |
| 76 |
}).each do |os,facts| |
| 77 |
context "on #{os}" do |
| 78 |
let (:facts) do |
| 79 |
facts.merge(OSDefaults.get_facts()) |
| 80 |
end |
| 81 |
|
| 82 |
it_configures 'nova-db-online-data-migrations' |
| 83 |
end |
| 84 |
end |
| 85 |
|
| 86 |
end |