Remove support for networking-vpp plugin
... because it was deprecated during Zed cycle by [1].
[1] 7a47c5a29d
Change-Id: I64da797bc921702f710e7328ef3e230354e2ceaf
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
Puppet::Type.type(:neutron_agent_vpp).provide(
|
|
||||||
:ini_setting,
|
|
||||||
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
|
|
||||||
) do
|
|
||||||
|
|
||||||
def self.file_path
|
|
||||||
'/etc/neutron/plugins/ml2/vpp_agent.ini'
|
|
||||||
end
|
|
||||||
|
|
||||||
# added for backwards compatibility with older versions of inifile
|
|
||||||
def file_path
|
|
||||||
self.class.file_path
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@@ -1,28 +0,0 @@
|
|||||||
Puppet::Type.newtype(:neutron_agent_vpp) do
|
|
||||||
|
|
||||||
ensurable
|
|
||||||
|
|
||||||
newparam(:name, :namevar => true) do
|
|
||||||
desc 'Section/setting name to manage from vpp agent config.'
|
|
||||||
newvalues(/\S+\/\S+/)
|
|
||||||
end
|
|
||||||
|
|
||||||
newproperty(:value) do
|
|
||||||
desc 'The value of the setting to be defined.'
|
|
||||||
munge do |value|
|
|
||||||
value = value.to_s.strip
|
|
||||||
value.capitalize! if value =~ /^(true|false)$/i
|
|
||||||
value
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
newparam(:ensure_absent_val) do
|
|
||||||
desc 'A value that is specified as the value property will behave as if ensure => absent was specified'
|
|
||||||
defaultto('<SERVICE DEFAULT>')
|
|
||||||
end
|
|
||||||
|
|
||||||
autorequire(:anchor) do
|
|
||||||
['neutron::install::end']
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@@ -1,99 +0,0 @@
|
|||||||
# == Class: neutron::agents::ml2::vpp
|
|
||||||
#
|
|
||||||
# DEPRECATED !!
|
|
||||||
# Configure networking-vpp Neutron agent for ML2 plugin.
|
|
||||||
#
|
|
||||||
# === Parameters
|
|
||||||
#
|
|
||||||
# [*package_ensure*]
|
|
||||||
# (optional) Package ensure state.
|
|
||||||
# Defaults to 'present'.
|
|
||||||
#
|
|
||||||
# [*enabled*]
|
|
||||||
# (required) Whether or not to enable the agent.
|
|
||||||
# Defaults to true.
|
|
||||||
#
|
|
||||||
# [*manage_service*]
|
|
||||||
# (optional) Whether to start/stop the service
|
|
||||||
# Defaults to true
|
|
||||||
#
|
|
||||||
# [*host*]
|
|
||||||
# (optional) Hostname to be used by the server, agents and services.
|
|
||||||
# Defaults to $::hostname
|
|
||||||
#
|
|
||||||
# [*physnets*]
|
|
||||||
# (optional) Comma-separated list of <physical_network>:<physical_interface>
|
|
||||||
# tuples mapping physical network names to agent's node-specific physical
|
|
||||||
# network interfaces. Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*etcd_host*]
|
|
||||||
# (optional) etcd server host name/ip
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*etcd_port*]
|
|
||||||
# (optional) etcd server listening port.
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*etcd_user*]
|
|
||||||
# (optional) User name for etcd authentication
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*etcd_pass*]
|
|
||||||
# (optional) Password for etcd authentication
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*purge_config*]
|
|
||||||
# (optional) Whether to set only the specified config options
|
|
||||||
# in the vpp config.
|
|
||||||
# Defaults to false.
|
|
||||||
#
|
|
||||||
class neutron::agents::ml2::vpp (
|
|
||||||
$package_ensure = 'present',
|
|
||||||
$enabled = true,
|
|
||||||
$manage_service = true,
|
|
||||||
$host = $::host,
|
|
||||||
$physnets = $::os_service_default,
|
|
||||||
$etcd_host = $::os_service_default,
|
|
||||||
$etcd_port = $::os_service_default,
|
|
||||||
$etcd_user = $::os_service_default,
|
|
||||||
$etcd_pass = $::os_service_default,
|
|
||||||
$purge_config = false,
|
|
||||||
) {
|
|
||||||
include neutron::deps
|
|
||||||
include neutron::params
|
|
||||||
|
|
||||||
warning('Support for the networking-vpp plugin has been deprecated.')
|
|
||||||
|
|
||||||
resources { 'neutron_agent_vpp':
|
|
||||||
purge => $purge_config,
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_agent_vpp {
|
|
||||||
'ml2_vpp/physnets': value => join(any2array($physnets), ',');
|
|
||||||
'ml2_vpp/etcd_host': value => $etcd_host;
|
|
||||||
'ml2_vpp/etcd_port': value => $etcd_port;
|
|
||||||
'ml2_vpp/etcd_user': value => $etcd_user;
|
|
||||||
'ml2_vpp/etcd_pass': value => $etcd_pass;
|
|
||||||
'DEFAULT/host': value => $host;
|
|
||||||
}
|
|
||||||
|
|
||||||
package { 'neutron-vpp-agent':
|
|
||||||
ensure => $package_ensure,
|
|
||||||
name => $::neutron::params::vpp_plugin_package,
|
|
||||||
tag => ['openstack', 'neutron-package'],
|
|
||||||
}
|
|
||||||
|
|
||||||
if $manage_service {
|
|
||||||
if $enabled {
|
|
||||||
$service_ensure = 'running'
|
|
||||||
} else {
|
|
||||||
$service_ensure = 'stopped'
|
|
||||||
}
|
|
||||||
service { 'neutron-vpp-agent-service':
|
|
||||||
ensure => $service_ensure,
|
|
||||||
name => $::neutron::params::vpp_agent_service,
|
|
||||||
enable => $enabled,
|
|
||||||
tag => ['neutron-service'],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -36,7 +36,6 @@ class neutron::deps {
|
|||||||
Anchor['neutron::config::begin'] -> Neutron_agent_linuxbridge<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_agent_linuxbridge<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_agent_macvtap<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_agent_macvtap<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_agent_ovs<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_agent_ovs<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_agent_vpp<||> ~> Anchor['neutron::config::end']
|
|
||||||
Anchor['neutron::config::begin'] -> Neutron_api_paste_ini<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_api_paste_ini<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_bagpipe_config<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_bagpipe_config<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_service_config<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_service_config<||> ~> Anchor['neutron::config::end']
|
||||||
|
@@ -12,8 +12,6 @@ class neutron::params {
|
|||||||
$macvtap_agent_service = 'neutron-macvtap-agent'
|
$macvtap_agent_service = 'neutron-macvtap-agent'
|
||||||
$opencontrail_plugin_package = 'neutron-plugin-contrail'
|
$opencontrail_plugin_package = 'neutron-plugin-contrail'
|
||||||
$opencontrail_config_file = '/etc/neutron/plugins/opencontrail/ContrailPlugin.ini'
|
$opencontrail_config_file = '/etc/neutron/plugins/opencontrail/ContrailPlugin.ini'
|
||||||
$vpp_plugin_package = 'python3-networking-vpp'
|
|
||||||
$vpp_agent_service = 'neutron-vpp-agent'
|
|
||||||
$nuage_config_file = '/etc/neutron/plugins/nuage/plugin.ini'
|
$nuage_config_file = '/etc/neutron/plugins/nuage/plugin.ini'
|
||||||
$dhcp_agent_service = 'neutron-dhcp-agent'
|
$dhcp_agent_service = 'neutron-dhcp-agent'
|
||||||
$metering_agent_service = 'neutron-metering-agent'
|
$metering_agent_service = 'neutron-metering-agent'
|
||||||
|
@@ -1,54 +0,0 @@
|
|||||||
# == Class: neutron::plugins::ml2::vpp
|
|
||||||
#
|
|
||||||
# DEPRECATED !!
|
|
||||||
# Install the networking-vpp ML2 mechanism driver and generate config file
|
|
||||||
# from parameters in the other classes.
|
|
||||||
#
|
|
||||||
# === Parameters
|
|
||||||
#
|
|
||||||
# [*etcd_host*]
|
|
||||||
# (optional) etcd server host name or IP.
|
|
||||||
# Defaults to $::os_service_default
|
|
||||||
#
|
|
||||||
# [*etcd_port*]
|
|
||||||
# (optional) etcd server listening port.
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*etcd_user*]
|
|
||||||
# (optional) User name for etcd authentication
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*etcd_pass*]
|
|
||||||
# (optional) Password for etcd authentication
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*l3_hosts*]
|
|
||||||
# (optional) List of hostnames to render L3 services on.
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
# [*enable_l3_ha*]
|
|
||||||
# (optional) Enable L3 HA feature.
|
|
||||||
# Defaults to $::os_service_default.
|
|
||||||
#
|
|
||||||
class neutron::plugins::ml2::vpp (
|
|
||||||
$etcd_host = $::os_service_default,
|
|
||||||
$etcd_port = $::os_service_default,
|
|
||||||
$etcd_user = $::os_service_default,
|
|
||||||
$etcd_pass = $::os_service_default,
|
|
||||||
$l3_hosts = $::os_service_default,
|
|
||||||
$enable_l3_ha = $::os_service_default,
|
|
||||||
) {
|
|
||||||
include neutron::deps
|
|
||||||
require neutron::plugins::ml2
|
|
||||||
|
|
||||||
warning('Support for the networking-vpp plugin has been deprecated.')
|
|
||||||
|
|
||||||
neutron_plugin_ml2 {
|
|
||||||
'ml2_vpp/etcd_host': value => $etcd_host;
|
|
||||||
'ml2_vpp/etcd_port': value => $etcd_port;
|
|
||||||
'ml2_vpp/etcd_user': value => $etcd_user;
|
|
||||||
'ml2_vpp/etcd_pass': value => $etcd_pass, secret => true;
|
|
||||||
'ml2_vpp/l3_hosts': value => join(any2array($l3_hosts), ',');
|
|
||||||
'ml2_vpp/enable_l3_ha': value => $enable_l3_ha;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
Support for the ``networking-vpp`` plugin has been removed.
|
@@ -13,8 +13,7 @@ describe 'basic neutron_config resource' do
|
|||||||
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
||||||
'/etc/neutron/vpn_agent.ini',
|
'/etc/neutron/vpn_agent.ini',
|
||||||
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
|
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
|
||||||
'/etc/neutron/plugins/ml2/sriov_agent.ini',
|
'/etc/neutron/plugins/ml2/sriov_agent.ini']
|
||||||
'/etc/neutron/plugins/ml2/vpp_agent.ini']
|
|
||||||
|
|
||||||
pp= <<-EOS
|
pp= <<-EOS
|
||||||
Exec { logoutput => 'on_failure' }
|
Exec { logoutput => 'on_failure' }
|
||||||
@@ -32,7 +31,6 @@ describe 'basic neutron_config resource' do
|
|||||||
File <||> -> Neutron_agent_linuxbridge <||>
|
File <||> -> Neutron_agent_linuxbridge <||>
|
||||||
File <||> -> Neutron_agent_ovs <||>
|
File <||> -> Neutron_agent_ovs <||>
|
||||||
File <||> -> Neutron_sriov_agent_config <||>
|
File <||> -> Neutron_sriov_agent_config <||>
|
||||||
File <||> -> Neutron_agent_vpp <||>
|
|
||||||
File <||> -> Neutron_l2gw_agent_config <||>
|
File <||> -> Neutron_l2gw_agent_config <||>
|
||||||
|
|
||||||
|
|
||||||
@@ -52,8 +50,7 @@ describe 'basic neutron_config resource' do
|
|||||||
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
'/etc/neutron/plugins/ml2/ml2_conf.ini',
|
||||||
'/etc/neutron/vpn_agent.ini',
|
'/etc/neutron/vpn_agent.ini',
|
||||||
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
|
'/etc/neutron/plugins/opencontrail/ContrailPlugin.ini',
|
||||||
'/etc/neutron/plugins/ml2/sriov_agent.ini',
|
'/etc/neutron/plugins/ml2/sriov_agent.ini']
|
||||||
'/etc/neutron/plugins/ml2/vpp_agent.ini']
|
|
||||||
|
|
||||||
file { $neutron_directories :
|
file { $neutron_directories :
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
@@ -278,24 +275,6 @@ describe 'basic neutron_config resource' do
|
|||||||
ensure_absent_val => 'toto',
|
ensure_absent_val => 'toto',
|
||||||
}
|
}
|
||||||
|
|
||||||
neutron_agent_vpp { 'DEFAULT/thisshouldexist' :
|
|
||||||
value => 'foo',
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_agent_vpp { 'DEFAULT/thisshouldnotexist' :
|
|
||||||
value => '<SERVICE DEFAULT>',
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_agent_vpp { 'DEFAULT/thisshouldexist2' :
|
|
||||||
value => '<SERVICE DEFAULT>',
|
|
||||||
ensure_absent_val => 'toto',
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_agent_vpp { 'DEFAULT/thisshouldnotexist2' :
|
|
||||||
value => 'toto',
|
|
||||||
ensure_absent_val => 'toto',
|
|
||||||
}
|
|
||||||
|
|
||||||
neutron_l2gw_service_config { 'DEFAULT/thisshouldexist' :
|
neutron_l2gw_service_config { 'DEFAULT/thisshouldexist' :
|
||||||
value => 'foo',
|
value => 'foo',
|
||||||
}
|
}
|
||||||
@@ -346,7 +325,6 @@ describe 'basic neutron_config resource' do
|
|||||||
'neutron_agent_linuxbridge',
|
'neutron_agent_linuxbridge',
|
||||||
'neutron_agent_ovs',
|
'neutron_agent_ovs',
|
||||||
'neutron_sriov_agent_config',
|
'neutron_sriov_agent_config',
|
||||||
'neutron_agent_vpp',
|
|
||||||
'neutron_l2gw_service_config',
|
'neutron_l2gw_service_config',
|
||||||
'neutron_l2gw_agent_config']
|
'neutron_l2gw_agent_config']
|
||||||
|
|
||||||
|
@@ -1,128 +0,0 @@
|
|||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe 'neutron::agents::ml2::vpp' do
|
|
||||||
let :pre_condition do
|
|
||||||
"class { 'neutron': }"
|
|
||||||
end
|
|
||||||
|
|
||||||
let :default_params do
|
|
||||||
{ :package_ensure => 'present',
|
|
||||||
:enabled => true,
|
|
||||||
:etcd_host => '127.0.0.1',
|
|
||||||
:etcd_port => 4001,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
let :params do
|
|
||||||
{}
|
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples 'neutron plugin vpp agent with ml2 plugin' do
|
|
||||||
let :p do
|
|
||||||
default_params.merge(params)
|
|
||||||
end
|
|
||||||
|
|
||||||
it { should contain_class('neutron::params') }
|
|
||||||
|
|
||||||
it 'passes purge to resource' do
|
|
||||||
should contain_resources('neutron_agent_vpp').with({
|
|
||||||
:purge => false
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures plugins/ml2/vpp_agent.ini' do
|
|
||||||
should contain_neutron_agent_vpp('ml2_vpp/physnets').with_value('<SERVICE DEFAULT>')
|
|
||||||
should contain_neutron_agent_vpp('ml2_vpp/etcd_user').with_value('<SERVICE DEFAULT>')
|
|
||||||
should contain_neutron_agent_vpp('ml2_vpp/etcd_pass').with_value('<SERVICE DEFAULT>')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'installs neutron vpp agent package' do
|
|
||||||
should contain_package('neutron-vpp-agent').with(
|
|
||||||
:name => platform_params[:vpp_plugin_package],
|
|
||||||
:ensure => p[:package_ensure],
|
|
||||||
:tag => ['openstack', 'neutron-package'],
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures neutron vpp agent service' do
|
|
||||||
should contain_service('neutron-vpp-agent-service').with(
|
|
||||||
:name => platform_params[:vpp_agent_service],
|
|
||||||
:enable => true,
|
|
||||||
:ensure => 'running',
|
|
||||||
:tag => ['neutron-service'],
|
|
||||||
)
|
|
||||||
should contain_service('neutron-vpp-agent-service').that_subscribes_to('Anchor[neutron::service::begin]')
|
|
||||||
should contain_service('neutron-vpp-agent-service').that_notifies('Anchor[neutron::service::end]')
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with manage_service as false' do
|
|
||||||
before :each do
|
|
||||||
params.merge!(:manage_service => false)
|
|
||||||
end
|
|
||||||
it 'should not manage the service' do
|
|
||||||
should_not contain_service('neutron-vpp-agent-service')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with the host parameter' do
|
|
||||||
before :each do
|
|
||||||
params.merge!(:host => 'myhost')
|
|
||||||
end
|
|
||||||
it 'should set the host parameter' do
|
|
||||||
should contain_neutron_agent_vpp('DEFAULT/host').with_value('myhost')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when supplying a physnet mapping' do
|
|
||||||
before :each do
|
|
||||||
params.merge!(:physnets => 'physnet0:GigabitEthernet2/2/0,physnet1:GigabitEthernet2/2/1')
|
|
||||||
end
|
|
||||||
it 'should configure physnets' do
|
|
||||||
should contain_neutron_agent_vpp('ml2_vpp/physnets').with_value('physnet0:GigabitEthernet2/2/0,physnet1:GigabitEthernet2/2/1')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when supplying a physnet mapping in array' do
|
|
||||||
before :each do
|
|
||||||
params.merge!(:physnets => ['physnet0:GigabitEthernet2/2/0', 'physnet1:GigabitEthernet2/2/1'])
|
|
||||||
end
|
|
||||||
it 'should configure physnets' do
|
|
||||||
should contain_neutron_agent_vpp('ml2_vpp/physnets').with_value('physnet0:GigabitEthernet2/2/0,physnet1:GigabitEthernet2/2/1')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when enabling etcd authentication' do
|
|
||||||
before :each do
|
|
||||||
params.merge!(:etcd_user => 'admin',
|
|
||||||
:etcd_pass => 'password' )
|
|
||||||
end
|
|
||||||
it 'should configure etcd username and password' do
|
|
||||||
should contain_neutron_agent_vpp('ml2_vpp/etcd_user').with_value('admin')
|
|
||||||
should contain_neutron_agent_vpp('ml2_vpp/etcd_pass').with_value('password')
|
|
||||||
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[:osfamily]
|
|
||||||
when 'Debian'
|
|
||||||
{ :vpp_plugin_package => 'python3-networking-vpp',
|
|
||||||
:vpp_agent_service => 'neutron-vpp-agent' }
|
|
||||||
when 'RedHat'
|
|
||||||
{ :vpp_plugin_package => 'python3-networking-vpp',
|
|
||||||
:vpp_agent_service => 'neutron-vpp-agent' }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
it_behaves_like 'neutron plugin vpp agent with ml2 plugin'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@@ -1,65 +0,0 @@
|
|||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe 'neutron::plugins::ml2::vpp' do
|
|
||||||
let :pre_condition do
|
|
||||||
"class { 'neutron::keystone::authtoken':
|
|
||||||
password => 'passw0rd',
|
|
||||||
}
|
|
||||||
class { 'neutron::server': }
|
|
||||||
class { 'neutron':
|
|
||||||
core_plugin => 'neutron.plugins.ml2.plugin.Ml2Plugin' }"
|
|
||||||
end
|
|
||||||
|
|
||||||
let :params do
|
|
||||||
{}
|
|
||||||
end
|
|
||||||
|
|
||||||
shared_examples 'neutron plugin vpp ml2' do
|
|
||||||
|
|
||||||
context 'with defaults' do
|
|
||||||
it 'configures ml2_vpp settings' do
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_host').with_value('<SERVICE DEFAULT>')
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_port').with_value('<SERVICE DEFAULT>')
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_user').with_value('<SERVICE DEFAULT>')
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_pass').with_value('<SERVICE DEFAULT>').with_secret(true)
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/l3_hosts').with_value('<SERVICE DEFAULT>')
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/enable_l3_ha').with_value('<SERVICE DEFAULT>')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with parameters' do
|
|
||||||
before :each do
|
|
||||||
params.merge!({
|
|
||||||
:etcd_host => '127.0.0.1',
|
|
||||||
:etcd_port => 4001,
|
|
||||||
:etcd_user => 'admin',
|
|
||||||
:etcd_pass => 'password',
|
|
||||||
:l3_hosts => ['192.0.2.10', '192.0.2.11'],
|
|
||||||
:enable_l3_ha => false,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures ml2_vpp settings' do
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_host').with_value('127.0.0.1')
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_port').with_value(4001)
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_user').with_value('admin')
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/etcd_pass').with_value('password').with_secret(true)
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/l3_hosts').with_value('192.0.2.10,192.0.2.11')
|
|
||||||
should contain_neutron_plugin_ml2('ml2_vpp/enable_l3_ha').with_value(false)
|
|
||||||
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
|
|
||||||
|
|
||||||
it_behaves_like 'neutron plugin vpp ml2'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@@ -1,51 +0,0 @@
|
|||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
provider_class = Puppet::Type.type(:neutron_agent_vpp).provider(:ini_setting)
|
|
||||||
|
|
||||||
describe provider_class do
|
|
||||||
|
|
||||||
it 'should default to the default setting when no other one is specified' do
|
|
||||||
resource = Puppet::Type::Neutron_agent_vpp.new(
|
|
||||||
{
|
|
||||||
:name => 'DEFAULT/foo',
|
|
||||||
:value => 'bar'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
provider = provider_class.new(resource)
|
|
||||||
expect(provider.section).to eq('DEFAULT')
|
|
||||||
expect(provider.setting).to eq('foo')
|
|
||||||
expect(provider.file_path).to eq('/etc/neutron/plugins/ml2/vpp_agent.ini')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should allow setting to be set explicitly' do
|
|
||||||
resource = Puppet::Type::Neutron_agent_vpp.new(
|
|
||||||
{
|
|
||||||
:name => 'dude/foo',
|
|
||||||
:value => 'bar'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
provider = provider_class.new(resource)
|
|
||||||
expect(provider.section).to eq('dude')
|
|
||||||
expect(provider.setting).to eq('foo')
|
|
||||||
expect(provider.file_path).to eq('/etc/neutron/plugins/ml2/vpp_agent.ini')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
|
|
||||||
resource = Puppet::Type::Neutron_agent_vpp.new(
|
|
||||||
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
|
|
||||||
)
|
|
||||||
provider = provider_class.new(resource)
|
|
||||||
provider.exists?
|
|
||||||
expect(resource[:ensure]).to eq :absent
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should ensure absent when value matches ensure_absent_val' do
|
|
||||||
resource = Puppet::Type::Neutron_agent_vpp.new(
|
|
||||||
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
|
|
||||||
)
|
|
||||||
provider = provider_class.new(resource)
|
|
||||||
provider.exists?
|
|
||||||
expect(resource[:ensure]).to eq :absent
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@@ -1,20 +0,0 @@
|
|||||||
require 'puppet'
|
|
||||||
require 'puppet/type/neutron_agent_vpp'
|
|
||||||
|
|
||||||
describe 'Puppet::Type.type(:neutron_agent_vpp)' do
|
|
||||||
|
|
||||||
before :each do
|
|
||||||
@neutron_agent_vpp = Puppet::Type.type(:neutron_agent_vpp).new(:name => 'DEFAULT/foo', :value => 'bar')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should autorequire the package that install the file' do
|
|
||||||
catalog = Puppet::Resource::Catalog.new
|
|
||||||
anchor = Puppet::Type.type(:anchor).new(:name => 'neutron::install::end')
|
|
||||||
catalog.add_resource anchor, @neutron_agent_vpp
|
|
||||||
dependency = @neutron_agent_vpp.autorequire
|
|
||||||
expect(dependency.size).to eq(1)
|
|
||||||
expect(dependency[0].target).to eq(@neutron_agent_vpp)
|
|
||||||
expect(dependency[0].source).to eq(anchor)
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
Reference in New Issue
Block a user