#
# tunnel_csum = False
+# (StrOpt) agent_type to report.
+# This config entry allows configuration of the neutron agent type reported
+# by the default ovs l2 agent. This allows multiple ovs mechanism drivers
+# to share a common ovs agent implementation. NOTE: this value will be
+# removed in the mitaka cycle.
+#
+# agent_type = 'Open vSwitch agent'
[securitygroup]
# Firewall driver for realizing neutron security group function.
from oslo_config import cfg
from neutron.agent.common import config
+from neutron.common import constants as n_const
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers.openvswitch.agent.common \
import constants
"cause brief traffic interruption.")),
cfg.BoolOpt('tunnel_csum', default=False,
help=_("Set or un-set the tunnel header checksum on "
- "outgoing IP packet carrying GRE/VXLAN tunnel."))
-
+ "outgoing IP packet carrying GRE/VXLAN tunnel.")),
+ cfg.StrOpt('agent_type', default=n_const.AGENT_TYPE_OVS,
+ deprecated_for_removal=True,
+ help=_("Selects the Agent Type reported"))
]
**kwargs)
self.assertEqual(expected, self.agent.int_br.datapath_type)
+ def test_agent_type_ovs(self):
+ # verify agent_type is default
+ expected = n_const.AGENT_TYPE_OVS
+ self.assertEqual(expected,
+ self.agent.agent_state['agent_type'])
+
+ def test_agent_type_alt(self):
+ with mock.patch.object(self.mod_agent.OVSNeutronAgent,
+ 'setup_integration_br'),\
+ mock.patch.object(self.mod_agent.OVSNeutronAgent,
+ 'setup_ancillary_bridges',
+ return_value=[]), \
+ mock.patch('neutron.agent.linux.utils.get_interface_mac',
+ return_value='00:00:00:00:00:01'), \
+ mock.patch(
+ 'neutron.agent.common.ovs_lib.BaseOVS.get_bridges'), \
+ mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
+ new=MockFixedIntervalLoopingCall), \
+ mock.patch(
+ 'neutron.agent.common.ovs_lib.OVSBridge.' 'get_vif_ports',
+ return_value=[]):
+ # validate setting non default agent_type
+ expected = 'alt agent type'
+ cfg.CONF.set_override('agent_type',
+ expected,
+ group='AGENT')
+ kwargs = self.mod_agent.create_agent_config_map(cfg.CONF)
+ self.agent = self.mod_agent.OVSNeutronAgent(self._bridge_classes(),
+ **kwargs)
+ self.assertEqual(expected,
+ self.agent.agent_state['agent_type'])
+
def test_restore_local_vlan_map_with_device_has_tag(self):
self._test_restore_local_vlan_maps(2)