Adding portdb and fastpath_flood to n1kv.conf

Also need to remove installing explicit installation of openvswitch
and call vswitch::ovs instead.
Adding testcases to neutron_agents_n1kv_vem_spec.rb and fixing an
error in neutron_plugins_ml2_spec.rb

Change-Id: I2b4ada801610d7081ac3e2469bcacd6ea5ec8e7d
Closes-Bug: 1421449
This commit is contained in:
Dulanjalie Ganegedara
2015-02-12 16:31:52 -08:00
parent 25a5ede55b
commit ba0eb6f2f6
3 changed files with 66 additions and 9 deletions

View File

@@ -91,6 +91,14 @@
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*portdb*]
# (optional) PortDB (ovs|vem)
# Defaults to ovs
#
# [*fastpath_flood*]
# (optional) Handle broadcast floods and unknown pkts in fastpath(KLM)
# Defaults to disable
#
class neutron::agents::n1kv_vem (
$n1kv_vsm_ip = '127.0.0.1',
$n1kv_vsm_domain_id = 1000,
@@ -103,10 +111,13 @@ class neutron::agents::n1kv_vem (
$n1kv_version = 'present',
$package_ensure = 'present',
$enable = true,
$manage_service = true
$manage_service = true,
$portdb = 'ovs',
$fastpath_flood = 'disable'
) {
include ::neutron::params
require vswitch::ovs
Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }
@@ -134,11 +145,6 @@ class neutron::agents::n1kv_vem (
name => $::neutron::params::libnl_package
}
package { 'openvswitch':
ensure => $package_ensure,
name => $::neutron::params::ovs_package
}
file {
'/etc/n1kv':
ensure => directory,
@@ -229,7 +235,7 @@ class neutron::agents::n1kv_vem (
}
Package['libnl'] -> Package['nexus1000v']
Package['openvswitch'] -> Package['nexus1000v']
Service['openvswitch'] ~> Package['nexus1000v']
File['/etc/n1kv/n1kv.conf'] -> Package['nexus1000v']
Package['nexus1000v'] ~> Service['nexus1000v']
}

View File

@@ -17,7 +17,7 @@ describe 'neutron::agents::n1kv_vem' do
it 'install n1kv-vem' do
should contain_package('libnl').with_before('Package[nexus1000v]')
should contain_package('openvswitch').with_before('Package[nexus1000v]')
should contain_service('openvswitch').with_notify('Package[nexus1000v]')
should contain_package('nexus1000v').with_notify('Service[nexus1000v]')
should contain_service('nexus1000v').with_ensure('running')
end
@@ -66,7 +66,9 @@ describe 'neutron::agents::n1kv_vem' do
{
:n1kv_vsm_ip => '9.0.0.1',
:n1kv_vsm_domain_id => 900,
:host_mgmt_intf => 'eth9'
:host_mgmt_intf => 'eth9',
:portdb => 'ovs',
:fastpath_flood => 'disable'
}
end
it do
@@ -76,12 +78,16 @@ describe 'neutron::agents::n1kv_vem' do
.with_content(/^switch-domain 900/)
should contain_file('/etc/n1kv/n1kv.conf') \
.with_content(/^host-mgmt-intf eth9/)
should contain_file('/etc/n1kv/n1kv.conf') \
.with_content(/^portdb ovs/)
should contain_file('/etc/n1kv/n1kv.conf') \
.without_content(/^phys/)
should contain_file('/etc/n1kv/n1kv.conf') \
.without_content(/^virt/)
should contain_file('/etc/n1kv/n1kv.conf') \
.with_content(/^node-type compute/)
should contain_file('/etc/n1kv/n1kv.conf') \
.with_content(/^fastpath-flood disable/)
end
end
@@ -99,6 +105,34 @@ describe 'neutron::agents::n1kv_vem' do
end
end
context 'verify portdb' do
let :params do
{
:portdb => 'vem',
}
end
it do
should contain_file('/etc/n1kv/n1kv.conf') \
.with_content(/^portdb vem/)
should contain_file('/etc/n1kv/n1kv.conf') \
.without_content(/^portdb ovs/)
end
end
context 'verify fastpath_flood' do
let :params do
{
:fastpath_flood => 'enable',
}
end
it do
should contain_file('/etc/n1kv/n1kv.conf') \
.with_content(/^fastpath-flood enable/)
should contain_file('/etc/n1kv/n1kv.conf') \
.without_content(/^fastpath-flood disable/)
end
end
context 'verify n1kv.conf with uplinks' do
let :params do
{

View File

@@ -81,6 +81,15 @@ virt <%= port%> profile <%= params['profile']%> mode static address <%= params['
# uvem-ovs-brname n1kvdvs
uvem-ovs-brname br-int
# TAG: portdb
# Description: PortDB (ovs|vem)
# Optional: YES.
# Default: ovs
# restart_on_modify: Yes
# Format:
# portdb vem
portdb <%= @portdb %>
# TAG: node-type
# Description: Type of Node: 'compute' (or) 'neutron'
# Optional: YES.
@@ -150,3 +159,11 @@ node-type <%= @node_type %>
# restart_on_modify: Yes
# Format: dp-thread-socket-rrnglen <0..16384>
# Note: 0 - disables memory map I/O
# TAG: fastpath-flood
# Description: Enable flood of broadcast and unknown pkts in KLM
# Optional: YES
# Default: disable
# restart_on_modify: Yes
# Format: fastpath-flood <enable|disable>
fastpath-flood <%= @fastpath_flood %>