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