3 describe 'neutron::agents::ml2::sriov' do
6 "class { 'neutron': rabbit_password => 'passw0rd' }"
10 { :package_ensure => 'present',
12 :physical_device_mappings => [],
13 :exclude_devices => [],
14 :polling_interval => 2,
22 shared_examples_for 'neutron sriov-nic agent with ml2 plugin' do
24 default_params.merge(params)
27 it { should contain_class('neutron::params') }
29 it 'configures ovs_neutron_plugin.ini' do
30 should contain_neutron_plugin_ml2('sriov_nic/polling_interval').with_value(p[:polling_interval])
31 should contain_neutron_plugin_ml2('sriov_nic/exclude_devices').with_value(p[:exclude_devices].join(','))
32 should contain_neutron_plugin_ml2('sriov_nic/physical_device_mappings').with_value(p[:physical_device_mappings].join(','))
35 it 'installs neutron sriov-nic agent package' do
36 should contain_package('neutron-sriov-nic-agent').with(
37 :name => platform_params[:sriov_nic_agent_package],
38 :ensure => p[:package_ensure]
40 should contain_package('neutron-sriov-nic-agent').with_before(/Neutron_plugin_ml2\[.+\]/)
43 it 'configures neutron ovs agent service' do
44 should contain_service('neutron-sriov-nic-agent-service').with(
45 :name => platform_params[:sriov_nic_agent_service],
48 :require => 'Class[Neutron]'
52 context 'when supplying device mapping' do
54 params.merge!(:physical_device_mappings => ['physnet1:eth1'],
55 :exclude_devices => ['physnet1:eth2'])
58 it 'configures physical device mappings with exclusion' do
59 should contain_neutron_plugin_ml2('sriov_nic/exclude_devices').with_value(['physnet1:eth2'])
60 should contain_neutron_plugin_ml2('sriov_nic/physical_device_mappings').with_value(['physnet1:eth1'])
65 context 'on Debian platforms' do
67 { :osfamily => 'Debian' }
70 let :platform_params do
71 { :sriov_nic_agent_package => 'neutron-plugin-sriov-agent',
72 :sriov_nic_agent_service => 'neutron-plugin-sriov-agent' }
75 it_configures 'neutron sriov-nic agent with ml2 plugin'
78 context 'on RedHat platforms' do
80 { :osfamily => 'RedHat' }
83 let :platform_params do
84 { :sriov_nic_agent_package => 'openstack-neutron-sriov-nic-agent',
85 :sriov_nic_agent_service => 'neutron-sriov-nic-agent' }
88 it_configures 'neutron sriov-nic agent with ml2 plugin'