def setUp(self):
     super(TestExcludeAttributePolicy, self).setUp()
     policy.init()
     self.addCleanup(policy.reset)
     plugin = manager.NeutronManager.get_plugin()
     ctx = context.get_admin_context()
     self.network_id = pecan_utils.create_network(ctx, plugin)['id']
     mock.patch('neutron.pecan_wsgi.controllers.resource.'
                'CollectionsController.get').start()
Beispiel #2
0
 def setUp(self):
     super(TestExcludeAttributePolicy, self).setUp()
     policy.init()
     self.addCleanup(policy.reset)
     plugin = directory.get_plugin()
     ctx = context.get_admin_context()
     self.network_id = pecan_utils.create_network(ctx, plugin)['id']
     mock.patch('neutron.pecan_wsgi.controllers.resource.'
                'CollectionsController.get').start()
 def setUp(self):
     cfg.CONF.set_override(
         'service_plugins',
         ['neutron.services.l3_router.l3_router_plugin.L3RouterPlugin'])
     super(TestRouterController, self).setUp()
     plugin = manager.NeutronManager.get_plugin()
     ctx = context.get_admin_context()
     service_plugins = manager.NeutronManager.get_service_plugins()
     l3_plugin = service_plugins[constants.L3_ROUTER_NAT]
     network_id = pecan_utils.create_network(ctx, plugin)['id']
     self.subnet = pecan_utils.create_subnet(ctx, plugin, network_id)
     self.router = pecan_utils.create_router(ctx, l3_plugin)
Beispiel #4
0
 def setUp(self):
     cfg.CONF.set_override(
         'service_plugins',
         ['neutron.services.l3_router.l3_router_plugin.L3RouterPlugin',
          'neutron.services.flavors.flavors_plugin.FlavorsPlugin'])
     super(TestRouterController, self).setUp()
     plugin = directory.get_plugin()
     ctx = context.get_admin_context()
     l3_plugin = directory.get_plugin(n_const.L3)
     network_id = pecan_utils.create_network(ctx, plugin)['id']
     self.subnet = pecan_utils.create_subnet(ctx, plugin, network_id)
     self.router = pecan_utils.create_router(ctx, l3_plugin)
Beispiel #5
0
 def setUp(self):
     cfg.CONF.set_override(
         'service_plugins',
         ['neutron.services.l3_router.l3_router_plugin.L3RouterPlugin'])
     super(TestRouterController, self).setUp()
     plugin = manager.NeutronManager.get_plugin()
     ctx = context.get_admin_context()
     service_plugins = manager.NeutronManager.get_service_plugins()
     l3_plugin = service_plugins[constants.L3_ROUTER_NAT]
     network_id = pecan_utils.create_network(ctx, plugin)['id']
     self.subnet = pecan_utils.create_subnet(ctx, plugin, network_id)
     self.router = pecan_utils.create_router(ctx, l3_plugin)
Beispiel #6
0
 def setUp(self):
     cfg.CONF.set_override(
         'service_plugins',
         ['neutron.services.l3_router.l3_router_plugin.L3RouterPlugin',
          'neutron.services.flavors.flavors_plugin.FlavorsPlugin'])
     super(TestRouterController, self).setUp()
     plugin = directory.get_plugin()
     ctx = context.get_admin_context()
     l3_plugin = directory.get_plugin(n_const.L3)
     network_id = pecan_utils.create_network(ctx, plugin)['id']
     self.subnet = pecan_utils.create_subnet(ctx, plugin, network_id)
     self.router = pecan_utils.create_router(ctx, l3_plugin)
Beispiel #7
0
 def setUp(self):
     super(TestDHCPAgentShimControllers, self).setUp()
     policy.init()
     policy._ENFORCER.set_rules(
         oslo_policy.Rules.from_dict(
             {'get_dhcp-agents': 'role:admin',
              'get_dhcp-networks': 'role:admin',
              'create_dhcp-networks': 'role:admin',
              'delete_dhcp-networks': 'role:admin'}),
         overwrite=False)
     plugin = directory.get_plugin()
     ctx = context.get_admin_context()
     self.network = pecan_utils.create_network(ctx, plugin)
     self.agent = helpers.register_dhcp_agent()
     # NOTE(blogan): Not sending notifications because this test is for
     # testing the shim controllers
     plugin.agent_notifiers[n_const.AGENT_TYPE_DHCP] = None
Beispiel #8
0
 def setUp(self):
     super(TestDHCPAgentShimControllers, self).setUp()
     policy.init()
     policy._ENFORCER.set_rules(
         oslo_policy.Rules.from_dict(
             {'get_dhcp-agents': 'role:admin',
              'get_dhcp-networks': 'role:admin',
              'create_dhcp-networks': 'role:admin',
              'delete_dhcp-networks': 'role:admin'}),
         overwrite=False)
     plugin = manager.NeutronManager.get_plugin()
     ctx = context.get_admin_context()
     self.network = pecan_utils.create_network(ctx, plugin)
     self.agent = helpers.register_dhcp_agent()
     # NOTE(blogan): Not sending notifications because this test is for
     # testing the shim controllers
     plugin.agent_notifiers[n_const.AGENT_TYPE_DHCP] = None