def setup_parent(self): """Perform parent setup with the common plugin configuration class.""" ext_mgr = (test_securitygroup.SecurityGroupTestExtensionManager()) # Ensure that the parent setup can be called without arguments # by the common configuration setUp. parent_setup = functools.partial( super(test_plugin.Ml2PluginV2TestCase, self).setUp, plugin=test_plugin.PLUGIN_NAME, ext_mgr=ext_mgr, ) self.useFixture(test_plugin.Ml2ConfFixture(parent_setup))
def setup_parent(self): """Perform parent setup with the common plugin configuration class.""" # Ensure that the parent setup can be called without arguments # by the common configuration setUp. service_plugins = {'l3_plugin_name': self.l3_plugin} service_plugins.update(self.get_additional_service_plugins()) parent_setup = functools.partial(super(test_plugin.Ml2PluginV2TestCase, self).setUp, plugin=self.get_plugins(), ext_mgr=self.get_ext_managers(), service_plugins=service_plugins) self.useFixture(test_plugin.Ml2ConfFixture(parent_setup))
def setup_parent(self): """Perform parent setup with the common plugin configuration class.""" ext_mgr = test_l3.L3TestExtensionManager() # Ensure that the parent setup can be called without arguments # by the common configuration setUp. parent_setup = functools.partial( super(test_plugin.Ml2PluginV2TestCase, self).setUp, plugin=test_plugin.PLUGIN_NAME, ext_mgr=ext_mgr, service_plugins={'l3_plugin_name': self.l3_plugin}, ) self.useFixture(test_plugin.Ml2ConfFixture(parent_setup))
def setup_parent(self): """Perform parent setup with the common plugin configuration class.""" l3_plugin = ('neutron.services.l3_router.l3_router_plugin.' 'L3RouterPlugin') service_plugins = { 'l3_plugin_name': l3_plugin, 'segments_plugin_name': 'neutron.services.segments.plugin.Plugin' } # Ensure that the parent setup can be called without arguments # by the common configuration setUp. parent_setup = functools.partial( super(WrsMl2PluginV2TestCase, self).setUp, plugin=PLUGIN_NAME, service_plugins=service_plugins, ) self.useFixture(test_ml2_plugin.Ml2ConfFixture(parent_setup))
import testscenarios from neutron.tests import base as tests_base from neutron.tests.retargetable import client_fixtures from neutron.tests.unit.plugins.ml2 import test_plugin # Each plugin must add a class to plugin_configurations that can configure the # plugin for use with PluginClient. For a given plugin, the setup # used for NeutronDbPluginV2TestCase can usually be reused. See the # configuration classes listed below for examples of this reuse. # TODO(marun) Discover plugin conf via a metaclass plugin_configurations = [ test_plugin.Ml2ConfFixture(), ] def rest_enabled(): return tests_base.bool_from_env('OS_TEST_API_WITH_REST') def get_plugin_scenarios(): scenarios = [] for conf in plugin_configurations: name = conf.plugin_name class_name = name.rsplit('.', 1)[-1] client = client_fixtures.PluginClientFixture(conf) scenarios.append((class_name, {'client': client})) return scenarios