Ejemplo n.º 1
0
 def test_dvr_enabled_dvr_snat_enabled(self, _runits, _rids, _rget,
                                       _get_os_cdnm_pkg, _os_release):
     self.test_config.set('use-dvr-snat', True)
     _runits.return_value = ['unit1']
     _rids.return_value = ['rid2']
     _os_release.return_value = 'stein'
     rdata = {
         'neutron-security-groups': 'True',
         'enable-dvr': 'True',
         'l2-population': 'True',
         'overlay-network-type': 'vxlan',
         'network-device-mtu': 1500,
         'l3_extension_plugins': 'fwaas_v2,fwaas_v2_log',
     }
     _rget.side_effect = lambda *args, **kwargs: rdata
     self.assertEqual(
         context.L3AgentContext()(), {
             'agent_mode': 'dvr_snat',
             'use_l3ha': False,
             'external_configuration_new': True,
             'enable_nfg_logging': False,
             'nfg_log_burst_limit': 25,
             'nfg_log_output_base': None,
             'nfg_log_rate_limit': None,
             'l3_extension_plugins': 'fwaas_v2',
         })
Ejemplo n.º 2
0
 def test_dvr_nfg_enabled_mins(self, _runits, _rids, _rget,
                               _validate_nfg_log_path, _get_os_cdnm_pkg,
                               _os_release):
     _runits.return_value = ['unit1']
     _rids.return_value = ['rid2']
     _os_release.return_value = 'stein'
     rdata = {
         'neutron-security-groups': 'True',
         'enable-dvr': 'True',
         'l2-population': 'True',
         'overlay-network-type': 'vxlan',
         'network-device-mtu': 1500,
         'enable-nfg-logging': 'True',
         'l3_extension_plugins': 'fwaas_v2,fwaas_v2_log',
     }
     _rget.side_effect = lambda *args, **kwargs: rdata
     _validate_nfg_log_path.side_effect = lambda x: x
     self.test_config.set('firewall-group-log-output-base',
                          '/var/log/neutron/firewall.log')
     self.test_config.set('firewall-group-log-rate-limit', 90)
     self.test_config.set('firewall-group-log-burst-limit', 20)
     self.assertEqual(
         context.L3AgentContext()(), {
             'agent_mode': 'dvr',
             'external_configuration_new': True,
             'enable_nfg_logging': True,
             'nfg_log_burst_limit': 25,
             'nfg_log_output_base': '/var/log/neutron/firewall.log',
             'nfg_log_rate_limit': 100,
             'use_l3ha': False,
             'l3_extension_plugins': 'fwaas_v2,fwaas_v2_log',
         })
Ejemplo n.º 3
0
 def test_dvr_disabled(self, _runits, _rids, _rget):
     _runits.return_value = ['unit1']
     _rids.return_value = ['rid2']
     rdata = {
         'neutron-security-groups': 'True',
         'enable-dvr': 'False',
         'l2-population': 'True',
         'overlay-network-type': 'vxlan',
         'network-device-mtu': 1500,
     }
     _rget.side_effect = lambda *args, **kwargs: rdata
     self.assertEqual(context.L3AgentContext()(), {'agent_mode': 'legacy'})
Ejemplo n.º 4
0
        'services': ['neutron-dhcp-agent'],
        'contexts': [DHCPAgentContext()],
    }),
    (NEUTRON_DNSMASQ_CONF, {
        'services': ['neutron-dhcp-agent'],
        'contexts': [DHCPAgentContext()],
    }),
    (NEUTRON_DHCP_DEFAULT, {
        'services': ['neutron-dhcp-agent'],
        'contexts': [DHCPAgentContext()],
    }),
])
DVR_RESOURCE_MAP = OrderedDict([
    (NEUTRON_L3_AGENT_CONF, {
        'services': ['neutron-l3-agent'],
        'contexts': [neutron_ovs_context.L3AgentContext()],
    }),
    (NEUTRON_FWAAS_CONF, {
        'services': ['neutron-l3-agent'],
        'contexts': [neutron_ovs_context.L3AgentContext()],
    }),
    (EXT_PORT_CONF, {
        'services': ['neutron-l3-agent'],
        'contexts': [context.ExternalPortContext()],
    }),
])
DPDK_RESOURCE_MAP = OrderedDict([
    (OVS_DEFAULT, {
        'services': ['openvswitch-switch'],
        'contexts': [
            DPDKDeviceContext(),