2015-06-29 15:46:13 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'neutron::db::sync' do
|
2018-11-28 17:43:42 +01:00
|
|
|
shared_examples 'neutron-dbsync' do
|
2020-10-12 10:46:40 +08:00
|
|
|
|
|
|
|
it { is_expected.to contain_class('neutron::deps') }
|
|
|
|
|
2015-06-29 15:46:13 +02:00
|
|
|
it 'runs neutron-db-sync' do
|
2018-11-28 17:43:42 +01:00
|
|
|
should contain_exec('neutron-db-sync').with(
|
2016-12-03 03:54:15 +00:00
|
|
|
:command => 'neutron-db-manage upgrade heads',
|
2015-06-29 15:46:13 +02:00
|
|
|
:path => '/usr/bin',
|
|
|
|
:refreshonly => 'true',
|
2016-12-01 17:26:45 +08:00
|
|
|
:try_sleep => 5,
|
|
|
|
:tries => 10,
|
2017-01-03 11:38:22 -05:00
|
|
|
:timeout => 300,
|
2016-12-01 17:26:45 +08:00
|
|
|
:logoutput => 'on_failure',
|
|
|
|
:subscribe => ['Anchor[neutron::install::end]',
|
|
|
|
'Anchor[neutron::config::end]',
|
|
|
|
'Anchor[neutron::dbsync::begin]'],
|
|
|
|
:notify => 'Anchor[neutron::dbsync::end]',
|
2018-03-12 16:33:09 +08:00
|
|
|
:tag => 'openstack-db',
|
2015-06-29 15:46:13 +02:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2015-11-02 22:34:06 +00:00
|
|
|
describe "overriding extra_params" do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:extra_params => '--config-file /etc/neutron/neutron.conf',
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it {
|
2018-11-28 17:43:42 +01:00
|
|
|
should contain_exec('neutron-db-sync').with(
|
2016-09-02 08:16:31 -04:00
|
|
|
:command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf upgrade heads',
|
2015-11-02 22:34:06 +00:00
|
|
|
:path => '/usr/bin',
|
|
|
|
:refreshonly => 'true',
|
2016-12-01 17:26:45 +08:00
|
|
|
:try_sleep => 5,
|
|
|
|
:tries => 10,
|
2017-01-03 11:38:22 -05:00
|
|
|
:timeout => 300,
|
|
|
|
:logoutput => 'on_failure',
|
|
|
|
:subscribe => ['Anchor[neutron::install::end]',
|
|
|
|
'Anchor[neutron::config::end]',
|
|
|
|
'Anchor[neutron::dbsync::begin]'],
|
|
|
|
:notify => 'Anchor[neutron::dbsync::end]',
|
2018-03-12 16:33:09 +08:00
|
|
|
:tag => 'openstack-db',
|
2017-01-03 11:38:22 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "overriding db_sync_timeout" do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:db_sync_timeout => 750,
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it {
|
2018-11-28 17:43:42 +01:00
|
|
|
should contain_exec('neutron-db-sync').with(
|
2017-01-03 11:38:22 -05:00
|
|
|
:command => 'neutron-db-manage upgrade heads',
|
|
|
|
:path => '/usr/bin',
|
|
|
|
:refreshonly => 'true',
|
|
|
|
:try_sleep => 5,
|
|
|
|
:tries => 10,
|
|
|
|
:timeout => 750,
|
2016-12-01 17:26:45 +08:00
|
|
|
:logoutput => 'on_failure',
|
|
|
|
:subscribe => ['Anchor[neutron::install::end]',
|
|
|
|
'Anchor[neutron::config::end]',
|
|
|
|
'Anchor[neutron::dbsync::begin]'],
|
|
|
|
:notify => 'Anchor[neutron::dbsync::end]',
|
2015-11-02 22:34:06 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2015-06-29 15:46:13 +02:00
|
|
|
end
|
|
|
|
|
2016-04-30 11:45:04 +08:00
|
|
|
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({
|
|
|
|
:processorcount => 8,
|
|
|
|
:concat_basedir => '/var/lib/puppet/concat'
|
|
|
|
}))
|
|
|
|
end
|
|
|
|
|
2018-11-28 17:43:42 +01:00
|
|
|
it_behaves_like 'neutron-dbsync'
|
2015-06-29 15:46:13 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|