From 3b6abf010a2c14f296044291cd381a6a7a4f92d9 Mon Sep 17 00:00:00 2001 From: "Mark T. Voelker" Date: Fri, 23 May 2014 14:33:48 -0400 Subject: [PATCH] Add parameter to set veth MTU In many applications (including in particular NFV), it is useful to use jumbo frames on veth pairs. The OVS agent has a setting enabling the user to set the MTU on veth interfaces, but it is currently not exposed as a parameter. This patch exposes the veth_mtu setting and adds rspec tests accordingly. Change-Id: I7b211be29a5630874b1c56e79ca80667f96ce425 --- manifests/agents/ovs.pp | 9 ++++++++- spec/classes/neutron_agents_ovs_spec.rb | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/manifests/agents/ovs.pp b/manifests/agents/ovs.pp index 289f67f17..30b40c5ea 100644 --- a/manifests/agents/ovs.pp +++ b/manifests/agents/ovs.pp @@ -21,7 +21,8 @@ $tunnel_bridge = 'br-tun', $vxlan_udp_port = 4789, $polling_interval = 2, - $firewall_driver = 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' + $firewall_driver = 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver', + $veth_mtu = undef ) { include neutron::params @@ -150,4 +151,10 @@ } } } + + if $veth_mtu { + neutron_plugin_ovs { 'AGENT/veth_mtu': value => $veth_mtu } + } else { + neutron_plugin_ovs { 'AGENT/veth_mtu': ensure => absent } + } } diff --git a/spec/classes/neutron_agents_ovs_spec.rb b/spec/classes/neutron_agents_ovs_spec.rb index 9c1c58181..1d233bbcb 100644 --- a/spec/classes/neutron_agents_ovs_spec.rb +++ b/spec/classes/neutron_agents_ovs_spec.rb @@ -18,7 +18,9 @@ :local_ip => false, :tunnel_bridge => 'br-tun', :polling_interval => 2, - :firewall_driver => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver' } + :firewall_driver => 'neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver', + :veth_mtu => '' + } end let :params do @@ -40,6 +42,7 @@ should contain_neutron_plugin_ovs('OVS/enable_tunneling').with_value(false) should contain_neutron_plugin_ovs('OVS/tunnel_bridge').with_ensure('absent') should contain_neutron_plugin_ovs('OVS/local_ip').with_ensure('absent') + should contain_neutron_plugin_ovs('AGENT/veth_mtu').with_ensure('absent') end it 'configures vs_bridge' do @@ -71,6 +74,16 @@ ) end + context 'with veth_mtu set' do + before :each do + params.merge(:veth_mtu => '9000') + end + + it 'should set the veth_mtu on the ovs agent' do + should contain_neutron_plugin_ovs('AGENT/veth_mtu').with_value(params[:veth_mtu]) + end + end + context 'when not installing ovs agent package' do before :each do params.merge!(:package_ensure => 'absent')