import hashlib
import logging
+import os
from oslo.config import cfg
from sqlalchemy.orm import exc as sa_exc
NVP_NOSNAT_RULES_ORDER = 10
NVP_FLOATINGIP_NAT_RULES_ORDER = 224
NVP_EXTGW_NAT_RULES_ORDER = 255
+NVP_EXT_PATH = os.path.join(os.path.dirname(__file__), 'extensions')
# Provider network extension - allowed network types for the NVP Plugin
'default': self._nvp_delete_port}
}
+ # If no api_extensions_path is provided set the following
+ if not cfg.CONF.api_extensions_path:
+ cfg.CONF.set_override('api_extensions_path', NVP_EXT_PATH)
self.nvp_opts = cfg.CONF.NVP
self.cluster = create_nvp_cluster(cfg.CONF,
self.nvp_opts.concurrent_connections,
--- /dev/null
+[DEFAULT]
+# Show more verbose log output (sets INFO log level output)
+verbose = True
+
+# Show debugging output in logs (sets DEBUG log level output)
+debug = False
+
+# Address to bind the API server
+bind_host = 0.0.0.0
+
+# Port the bind the API server to
+bind_port = 9696
+
+# MISSING Path to the extensions
+# api_extensions_path =
+
+# Paste configuration file
+api_paste_config = api-paste.ini.test
+
+# The messaging module to use, defaults to kombu.
+rpc_backend = quantum.openstack.common.rpc.impl_fake
+
+lock_path = $state_path/lock
+
+[DATABASE]
+sql_connection = 'sqlite:///:memory:'
+
+[default_servicetype]
+description = "default service type"
+service_definition=dummy:quantum.tests.unit.dummy_plugin.QuantumDummyPlugin
+
BASE_CONF_PATH = os.path.join(os.path.dirname(__file__),
'../../etc/quantum.conf.test')
+NVP_BASE_CONF_PATH = os.path.join(os.path.dirname(__file__),
+ 'etc/quantum.conf.test')
NVP_INI_PATH = os.path.join(os.path.dirname(__file__),
'etc/nvp.ini.basic.test')
NVP_INI_FULL_PATH = os.path.join(os.path.dirname(__file__),
self.assertIsNone(cfg.CONF.default_l2_gw_service_uuid)
self.assertEqual('breth0', cfg.CONF.default_interface_name)
+ def test_load_api_extensions(self):
+ q_config.parse(['--config-file', NVP_BASE_CONF_PATH,
+ '--config-file', NVP_INI_FULL_PATH])
+ cfg.CONF.set_override('core_plugin', NVP_PLUGIN_PATH)
+ # Load the configuration, and initialize the plugin
+ QuantumManager().get_plugin()
+ self.assertIn('extensions', cfg.CONF.api_extensions_path)
+
class OldConfigurationTest(testtools.TestCase):