puppet-neutron/spec/classes/neutron_agents_bigswitch.rb
ZhongShengping b9e73b3099 Remove deprecated rabbit params
Remove the deprecated rabbit params which has been deprecated for
two years. The default_transport_url has been present for a while
now and should be used.

Change-Id: I6b239ffca2184f553311428b92cd7043b4289b63
2018-06-11 09:53:19 +08:00

115 lines
2.5 KiB
Ruby

require 'spec_helper'
describe 'neutron::agents::bigswitch' do
let :pre_condition do
"class { 'neutron': }"
end
let :test_facts do
{
:operatingsystem => 'default',
:operatingsystemrelease => 'default',
:package_ensure => 'present',
}
end
shared_examples_for 'neutron bigswitch base' do
it 'should have' do
is_expected.to contain_package('python-networking-bigswitch').with(
:ensure => 'present',
:tag => 'openstack'
)
end
end
context 'neutron-bsn-agent only' do
let :facts do
@default_facts.merge(test_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7'
}))
end
let :params do
{
:lldp_enabled => false,
:agent_enabled => true
}
end
it_configures 'neutron bigswitch base'
it 'enable neutron-bsn-agent service' do
is_expected.to contain_service('bigswitch-agent').with(
:enable => params[:agent_enabled],
:ensure =>'running',
:tag =>'neutron-service',
)
end
it 'disable neutron-bsn-lldp service' do
is_expected.to contain_service('bigswitch-lldp').with(
:enable => params[:lldp_enabled],
:ensure =>'stopped',
:tag =>'neutron-service',
)
end
end
context 'neutron-bsn-lldp only' do
let :facts do
@default_facts.merge(test_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7'
}))
end
let :params do
{
:lldp_enabled => true,
:agent_enabled => false
}
end
it_configures 'neutron bigswitch base'
it 'disable neutron-bsn-agent service' do
is_expected.to contain_service('bigswitch-agent').with(
:enable => params[:agent_enabled],
:ensure =>'stopped',
:tag =>'neutron-service',
)
end
it 'enable neutron-bsn-lldp service' do
is_expected.to contain_service('bigswitch-lldp').with(
:enable => params[:lldp_enabled],
:ensure =>'running',
:tag =>'neutron-service',
)
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge(test_facts.merge({
:osfamily => 'Debian'
}))
end
let :params do
{
:lldp_enabled => false,
:agent_enabled => false
}
end
it { is_expected.to raise_error(Puppet::Error, /Unsupported osfamily Debian/) }
end
end