Exemple #1
0
 def test_load_api_extensions(self):
     q_config.parse(['--config-file', BASE_CONF_PATH,
                     '--config-file', NSX_INI_FULL_PATH])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     # Load the configuration, and initialize the plugin
     NeutronManager().get_plugin()
     self.assertIn('extensions', cfg.CONF.api_extensions_path)
Exemple #2
0
 def test_load_plugin_with_full_options(self):
     q_config.parse(['--config-file', BASE_CONF_PATH,
                     '--config-file', NSX_INI_FULL_PATH])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     plugin = NeutronManager().get_plugin()
     cluster = plugin.cluster
     self._assert_required_options(cluster)
     self._assert_extra_options(cluster)
Exemple #3
0
 def test_agent_extensions(self):
     q_config.parse([
         '--config-file', BASE_CONF_PATH, '--config-file', NSX_INI_FULL_PATH
     ])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     self.assertEqual(config.AgentModes.AGENT, cfg.CONF.NSX.agent_mode)
     plugin = NeutronManager().get_plugin()
     self.assertIn('agent', plugin.supported_extension_aliases)
     self.assertIn('dhcp_agent_scheduler',
                   plugin.supported_extension_aliases)
Exemple #4
0
 def test_agentless_extensions(self):
     self.skipTest('Enable once agentless support is added')
     q_config.parse([
         '--config-file', NVP_BASE_CONF_PATH, '--config-file',
         NVP_INI_AGENTLESS_PATH
     ])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     self.assertEqual(config.AgentModes.AGENTLESS, cfg.CONF.NVP.agent_mode)
     plugin = NeutronManager().get_plugin()
     self.assertNotIn('agent', plugin.supported_extension_aliases)
     self.assertNotIn('dhcp_agent_scheduler',
                      plugin.supported_extension_aliases)
Exemple #5
0
 def test_load_plugin_with_deprecated_options(self):
     q_config.parse(['--config-file', BASE_CONF_PATH,
                     '--config-file', NVP_INI_DEPR_PATH])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     plugin = NeutronManager().get_plugin()
     cluster = plugin.cluster
     # Verify old nvp_* params have been fully parsed
     self._assert_required_options(cluster)
     self.assertEqual(4, cluster.req_timeout)
     self.assertEqual(3, cluster.http_timeout)
     self.assertEqual(2, cluster.retries)
     self.assertEqual(2, cluster.redirects)
Exemple #6
0
 def test_agentless_extensions(self):
     q_config.parse(['--config-file', BASE_CONF_PATH,
                     '--config-file', NSX_INI_AGENTLESS_PATH])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     self.assertEqual(config.AgentModes.AGENTLESS,
                      cfg.CONF.NSX.agent_mode)
     # The version returned from NSX does not really matter here
     with mock.patch.object(client.NsxApiClient,
                            'get_version',
                            return_value=version.Version("9.9")):
         with mock.patch.object(lsnlib,
                                'service_cluster_exists',
                                return_value=True):
             plugin = NeutronManager().get_plugin()
             self.assertNotIn('agent',
                              plugin.supported_extension_aliases)
             self.assertNotIn('dhcp_agent_scheduler',
                              plugin.supported_extension_aliases)
 def test_combined_extensions(self):
     q_config.parse(['--config-file', BASE_CONF_PATH,
                     '--config-file', NSX_INI_COMBINED_PATH])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     self.assertEqual(config.AgentModes.COMBINED,
                      cfg.CONF.NSX.agent_mode)
     with mock.patch.object(client.NsxApiClient,
                            'get_version',
                            return_value=version.Version("4.2")):
         with mock.patch.object(lsnlib,
                                'service_cluster_exists',
                                return_value=True):
             plugin = NeutronManager().get_plugin()
             self.assertIn('agent',
                           plugin.supported_extension_aliases)
             self.assertIn('dhcp_agent_scheduler',
                           plugin.supported_extension_aliases)
             self.assertIn('lsn',
                           plugin.supported_extension_aliases)
Exemple #8
0
 def test_load_plugin_with_required_options_only(self):
     q_config.parse(
         ['--config-file', BASE_CONF_PATH, '--config-file', NVP_INI_PATH])
     cfg.CONF.set_override('core_plugin', PLUGIN_NAME)
     plugin = NeutronManager().get_plugin()
     self._assert_required_options(plugin.cluster)