--- /dev/null
+[composite:quantum]
+use = egg:Paste#urlmap
+/: quantumversions
+/v1.0: quantumapi_v1_0
+/v1.1: quantumapi_v1_1
+/v2.0: quantumapi_v2_0
+
+[pipeline:quantumapi_v1_0]
+# By default, authentication is disabled.
+# To enable Keystone integration comment out the
+# following line and uncomment the next one
+pipeline = extensions quantumapiapp_v1_0
+# pipeline = authtoken keystonecontext extensions quantumapiapp_v1_0
+
+[pipeline:quantumapi_v1_1]
+# By default, authentication is disabled.
+# To enable Keystone integration comment out the
+# following line and uncomment the next one
+pipeline = extensions quantumapiapp_v1_1
+# pipeline = authtoken keystonecontext extensions quantumapiapp_v1_1
+
+[pipeline:quantumapi_v2_0]
+# By default, authentication is disabled.
+# To enable Keystone integration comment out the
+# following line and uncomment the next one
+pipeline = extensions quantumapiapp_v2_0
+# pipeline = authtoken keystonecontext extensions quantumapiapp_v2_0
+
+[filter:keystonecontext]
+paste.filter_factory = quantum.auth:QuantumKeystoneContext.factory
+
+[filter:authtoken]
+paste.filter_factory = keystone.middleware.auth_token:filter_factory
+auth_host = 127.0.0.1
+auth_port = 35357
+auth_protocol = http
+admin_tenant_name = %SERVICE_TENANT_NAME%
+admin_user = %SERVICE_USER%
+admin_password = %SERVICE_PASSWORD%
+
+[filter:extensions]
+paste.filter_factory = quantum.extensions.extensions:plugin_aware_extension_middleware_factory
+
+[app:quantumversions]
+paste.app_factory = quantum.api.versions:Versions.factory
+
+[app:quantumapiapp_v1_0]
+paste.app_factory = quantum.api:APIRouterV10.factory
+
+[app:quantumapiapp_v1_1]
+paste.app_factory = quantum.api:APIRouterV11.factory
+
+[app:quantumapiapp_v2_0]
+paste.app_factory = quantum.api.v2.router:APIRouter.factory
# Quantum plugin provider module
core_plugin = quantum.plugins.sample.SamplePlugin.FakePlugin
-[composite:quantum]
-use = egg:Paste#urlmap
-/: quantumversions
-/v1.0: quantumapi_v1_0
-/v1.1: quantumapi_v1_1
-/v2.0: quantumapi_v2_0
-
-[pipeline:quantumapi_v1_0]
-# By default, authentication is disabled.
-# To enable Keystone integration comment out the
-# following line and uncomment the next one
-pipeline = extensions quantumapiapp_v1_0
-# pipeline = authtoken keystonecontext extensions quantumapiapp_v1_0
-
-[pipeline:quantumapi_v1_1]
-# By default, authentication is disabled.
-# To enable Keystone integration comment out the
-# following line and uncomment the next one
-pipeline = extensions quantumapiapp_v1_1
-# pipeline = authtoken keystonecontext extensions quantumapiapp_v1_1
-
-[pipeline:quantumapi_v2_0]
-# By default, authentication is disabled.
-# To enable Keystone integration comment out the
-# following line and uncomment the next one
-pipeline = extensions quantumapiapp_v2_0
-# pipeline = authtoken keystonecontext extensions quantumapiapp_v2_0
-
-[filter:keystonecontext]
-paste.filter_factory = quantum.auth:QuantumKeystoneContext.factory
-
-[filter:authtoken]
-paste.filter_factory = keystone.middleware.auth_token:filter_factory
-auth_host = 127.0.0.1
-auth_port = 35357
-auth_protocol = http
-admin_tenant_name = %SERVICE_TENANT_NAME%
-admin_user = %SERVICE_USER%
-admin_password = %SERVICE_PASSWORD%
-
-[filter:extensions]
-paste.filter_factory = quantum.extensions.extensions:plugin_aware_extension_middleware_factory
-
-[app:quantumversions]
-paste.app_factory = quantum.api.versions:Versions.factory
-
-[app:quantumapiapp_v1_0]
-paste.app_factory = quantum.api:APIRouterV10.factory
-
-[app:quantumapiapp_v1_1]
-paste.app_factory = quantum.api:APIRouterV11.factory
-
-[app:quantumapiapp_v2_0]
-paste.app_factory = quantum.api.v2.router:APIRouter.factory
+# Paste configuration file
+api_paste_config = api-paste.ini
bind_opts = [
cfg.StrOpt('bind_host', default='0.0.0.0'),
cfg.IntOpt('bind_port', default=9696),
+ cfg.StrOpt('api_paste_config', default="api-paste.ini"),
cfg.StrOpt('api_extensions_path', default=""),
cfg.StrOpt('core_plugin',
default='quantum.plugins.sample.SamplePlugin.FakePlugin'),
root_logger.addHandler(handler)
-def load_paste_app(app_name, config_file):
+def load_paste_app(app_name):
"""
Builds and returns a WSGI app from a paste config file.
:param app_name: Name of the application to load
- :param config_file: name of the configuration file
:raises RuntimeError when config file cannot be located or application
cannot be loaded from config file
"""
- config_path = os.path.abspath(cfg.CONF.find_file(config_file))
+ config_path = os.path.abspath(cfg.CONF.find_file(
+ cfg.CONF.api_paste_config))
LOG.info("Config paste file: %s", config_path)
try:
--- /dev/null
+[pipeline:extensions_app_with_filter]
+pipeline = extensions extensions_test_app
+
+[filter:extensions]
+paste.filter_factory = quantum.extensions.extensions:plugin_aware_extension_middleware_factory
+
+[app:extensions_test_app]
+paste.app_factory = quantum.plugins.cisco.tests.unit.test_cisco_extension:app_factory
# Path to the extensions
api_extensions_path = ../../../../extensions
-[pipeline:extensions_app_with_filter]
-pipeline = extensions extensions_test_app
+# Paste configuration file
+api_paste_config = api-paste.ini.cisco.test
-[filter:extensions]
-paste.filter_factory = quantum.extensions.extensions:plugin_aware_extension_middleware_factory
-
-[app:extensions_test_app]
-paste.app_factory = quantum.plugins.cisco.tests.unit.test_cisco_extension:app_factory
+core_plugin = quantum.plugins.cisco.l2network_plugin.L2Network
LOG = logging.getLogger('quantum.plugins.cisco.tests.test_cisco_extensions')
-TEST_CONF_FILE = config.find_config_file({'plugin': 'cisco'},
- 'quantum.conf.ciscoext')
EXTENSIONS_PATH = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
os.pardir, os.pardir, "extensions")
+ROOTDIR = os.path.dirname(os.path.dirname(__file__))
+UNITDIR = os.path.join(ROOTDIR, 'unit')
+
+
+def testsdir(*p):
+ return os.path.join(UNITDIR, *p)
+
+config_file = 'quantum.conf.cisco.test'
+args = ['--config-file', testsdir(config_file)]
+config.parse(args=args)
+
class ExtensionsTestApp(wsgi.Router):
}
self.tenant_id = "test_tenant"
self.network_name = "test_network"
- options = {}
- options['plugin_provider'] = ('quantum.plugins.cisco.l2network_plugin'
- '.L2Network')
- self.api = server.APIRouterV10(options)
+ self.api = server.APIRouterV10()
self._l2network_plugin = l2network_plugin.L2Network()
def test_list_portprofile(self):
}
self.tenant_id = "test_tenant"
self.network_name = "test_network"
- options = {}
- options['plugin_provider'] = (
- 'quantum.plugins.cisco.l2network_plugin.L2Network')
- self.api = server.APIRouterV10(options)
+ self.api = server.APIRouterV10()
self._l2network_plugin = l2network_plugin.L2Network()
def create_request(self, path, body, content_type, method='GET'):
extension_manager = (extension_manager or
PluginAwareExtensionManager(EXTENSIONS_PATH,
L2Network()))
- options = {'config_file': TEST_CONF_FILE}
- app = config.load_paste_app('extensions_test_app', options, None)
+ app = config.load_paste_app('extensions_test_app')
return ExtensionMiddleware(app, ext_mgr=extension_manager)
def _run_wsgi(app_name):
- app = config.load_paste_app(app_name, "quantum.conf")
+ app = config.load_paste_app(app_name)
if not app:
LOG.error(_('No known API applications configured.'))
return
--- /dev/null
+[pipeline:extensions_app_with_filter]
+pipeline = extensions extensions_test_app
+
+[filter:extensions]
+paste.filter_factory = quantum.common.extensions:plugin_aware_extension_middleware_factory
+
+[app:extensions_test_app]
+paste.app_factory = quantum.tests.unit.test_extensions:app_factory
# Path to the extensions
api_extensions_path = unit/extensions
-[pipeline:extensions_app_with_filter]
-pipeline = extensions extensions_test_app
-
-[filter:extensions]
-paste.filter_factory = quantum.common.extensions:plugin_aware_extension_middleware_factory
-
-[app:extensions_test_app]
-paste.app_factory = quantum.tests.unit.test_extensions:app_factory
+# Paste configuration file
+api_paste_config = api-paste.ini.test
config_file = 'quantum.conf.test'
args = ['--config-file', etcdir(config_file)]
config.parse(args=args)
- app = config.load_paste_app('extensions_test_app', config_file)
+ app = config.load_paste_app('extensions_test_app')
return app
config_file = 'quantum.conf.test'
args = ['--config-file', etcdir(config_file)]
config.parse(args=args)
- app = config.load_paste_app('extensions_test_app', config_file)
+ app = config.load_paste_app('extensions_test_app')
return ExtensionMiddleware(app, ext_mgr=extension_manager)
DataFiles = [
(config_path,
- ['etc/quantum.conf']),
+ ['etc/quantum.conf', 'etc/api-paste.ini', 'etc/policy.json']),
(init_path, ['etc/init.d/quantum-server']),
(ovs_plugin_config_path,
['etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini']),