puppet-neutron/spec/classes/neutron_plugins_ml2_networking_baremetal_spec.rb
Takashi Kajinami 4f9ea57cb2 Replace legacy facts and use fact hash
... because the latest lint no longer allows usage of legacy facts and
top scope fact.

Change-Id: Id66d5ae7904998aa8bbf42f3b2a49ec0748507b4
2023-03-02 12:21:36 +09:00

52 lines
1.4 KiB
Ruby

require 'spec_helper'
describe 'neutron::plugins::ml2::networking_baremetal' do
let :default_params do
{
:package_ensure => 'present',
}
end
let :params do
{}
end
shared_examples 'networking-baremetal ml2 plugin' do
let :p do
default_params.merge(params)
end
it { should contain_class('neutron::params') }
it 'installs networking-baremetal python-networking-baremetal package' do
should contain_package('python-networking-baremetal').with(
:name => platform_params[:networking_baremetal_package],
:ensure => p[:package_ensure],
:tag => ['openstack', 'neutron-plugin-ml2-package'],
)
should contain_package('python-networking-baremetal').that_requires('Anchor[neutron::install::begin]')
should contain_package('python-networking-baremetal').that_notifies('Anchor[neutron::config::end]')
end
end
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())
end
let (:platform_params) do
case facts[:os]['family']
when 'Debian'
{ :networking_baremetal_package => 'python3-ironic-neutron-agent'}
when 'RedHat'
{ :networking_baremetal_package => 'python3-networking-baremetal'}
end
end
it_behaves_like 'networking-baremetal ml2 plugin'
end
end
end