Files
puppet-neutron/spec/classes/neutron_db_sync_spec.rb
Nate Potter 091116d509 Allow customization of db sync command line
Add $extra_params parameter to neutron::db::sync class to
allow end users to add command line parameters to db sync command.

Change-Id: Ideeeb70115bcec8526444c142b54890707bfbf61
Partial-bug: #1472740
2015-11-16 19:10:23 +00:00

61 lines
1.5 KiB
Ruby

require 'spec_helper'
describe 'neutron::db::sync' do
shared_examples_for 'neutron-dbsync' do
it 'runs neutron-db-sync' do
is_expected.to contain_exec('neutron-db-sync').with(
:command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head',
:path => '/usr/bin',
:refreshonly => 'true',
:logoutput => 'on_failure'
)
end
describe "overriding extra_params" do
let :params do
{
:extra_params => '--config-file /etc/neutron/neutron.conf',
}
end
it {
is_expected.to contain_exec('neutron-db-sync').with(
:command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf upgrade head',
:path => '/usr/bin',
:refreshonly => 'true',
:logoutput => 'on_failure'
)
}
end
end
context 'on a RedHat osfamily' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '7.0',
:concat_basedir => '/var/lib/puppet/concat'
}
end
it_configures 'neutron-dbsync'
end
context 'on a Debian osfamily' do
let :facts do
{
:operatingsystemrelease => '7.8',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:concat_basedir => '/var/lib/puppet/concat'
}
end
it_configures 'neutron-dbsync'
end
end