コード例 #1
0
ファイル: test_routes.py プロジェクト: Anonymike/quark
 def test_create_route_gateway_conflict_raises(self):
     cidr = "192.168.0.0/24"
     ip_policy = dict(exclude=["192.168.0.0/32", "192.168.0.255/32"])
     ip_policy = {"ip_policy": ip_policy}
     network = dict(name="public", tenant_id="fake", network_plugin="BASE")
     network = {"network": network}
     subnet = dict(ip_version=4, next_auto_assign_ip=2,
                   cidr=cidr, ip_policy=None,
                   tenant_id="fake")
     create_route = dict(cidr="192.168.0.0/24", gateway="192.168.0.1")
     subnet = {"subnet": subnet}
     with self._stubs(network, subnet, ip_policy) as (net, sub, ipp):
         self.assertIsNotNone(net)
         self.assertIsNotNone(sub)
         self.assertIsNotNone(ipp)
         create_route["subnet_id"] = sub["id"]
         with self.assertRaises(n_exc.BadRequest):
             routes_api.create_route(self.context,
                                     dict(route=create_route))
コード例 #2
0
ファイル: test_routes.py プロジェクト: MultipleCrashes/quark
 def test_create_route_gateway_conflict_raises(self):
     cidr = "192.168.0.0/24"
     ip_policy = dict(exclude=["192.168.0.0/32", "192.168.0.255/32"])
     ip_policy = {"ip_policy": ip_policy}
     network = dict(name="public", tenant_id="fake", network_plugin="BASE")
     network = {"network": network}
     subnet = dict(ip_version=4,
                   next_auto_assign_ip=2,
                   cidr=cidr,
                   ip_policy=None,
                   tenant_id="fake")
     create_route = dict(cidr="192.168.0.0/24", gateway="192.168.0.1")
     subnet = {"subnet": subnet}
     with self._stubs(network, subnet, ip_policy) as (net, sub, ipp):
         self.assertIsNotNone(net)
         self.assertIsNotNone(sub)
         self.assertIsNotNone(ipp)
         create_route["subnet_id"] = sub["id"]
         with self.assertRaises(n_exc.BadRequest):
             routes_api.create_route(self.context, dict(route=create_route))
コード例 #3
0
ファイル: test_routes.py プロジェクト: lmaycotte/quark
 def test_create_no_other_routes(self):
     cidr = "192.168.0.0/24"
     ip_policy = dict(exclude=["192.168.0.0/32", "192.168.0.1/32",
                               "192.168.0.255/32"])
     ip_policy = {"ip_policy": ip_policy}
     network = dict(name="public", tenant_id="fake", network_plugin="BASE")
     network = {"network": network}
     subnet = dict(ip_version=4, cidr=cidr, ip_policy=None,
                   tenant_id="fake")
     create_route = dict(cidr="192.168.0.0/24", gateway="192.168.0.1")
     subnet = {"subnet": subnet}
     with self._stubs(network, subnet, ip_policy) as (net, sub, ipp):
         self.assertIsNotNone(net)
         self.assertIsNotNone(sub)
         self.assertIsNotNone(ipp)
         create_route["subnet_id"] = sub["id"]
         route = routes_api.create_route(self.context,
                                         dict(route=create_route))
         for key in create_route.keys():
             self.assertEqual(create_route[key], route[key])
コード例 #4
0
ファイル: test_routes.py プロジェクト: MultipleCrashes/quark
 def test_create_no_other_routes(self):
     cidr = "192.168.0.0/24"
     ip_policy = dict(
         exclude=["192.168.0.0/32", "192.168.0.1/32", "192.168.0.255/32"])
     ip_policy = {"ip_policy": ip_policy}
     network = dict(name="public", tenant_id="fake", network_plugin="BASE")
     network = {"network": network}
     subnet = dict(ip_version=4,
                   cidr=cidr,
                   ip_policy=None,
                   tenant_id="fake")
     create_route = dict(cidr="192.168.0.0/24", gateway="192.168.0.1")
     subnet = {"subnet": subnet}
     with self._stubs(network, subnet, ip_policy) as (net, sub, ipp):
         self.assertIsNotNone(net)
         self.assertIsNotNone(sub)
         self.assertIsNotNone(ipp)
         create_route["subnet_id"] = sub["id"]
         route = routes_api.create_route(self.context,
                                         dict(route=create_route))
         for key in create_route.keys():
             self.assertEqual(create_route[key], route[key])
コード例 #5
0
ファイル: plugin.py プロジェクト: lmaycotte/quark
 def create_route(self, context, route):
     self._fix_missing_tenant_id(context, route["route"])
     return routes.create_route(context, route)
コード例 #6
0
ファイル: plugin.py プロジェクト: blamarvt/quark
 def create_route(self, context, route):
     return routes.create_route(context, route)
コード例 #7
0
ファイル: plugin.py プロジェクト: thomasem/quark
 def create_route(self, context, route):
     self._fix_missing_tenant_id(context, route["route"])
     return routes.create_route(context, route)
コード例 #8
0
ファイル: plugin.py プロジェクト: kilogram/quark
 def create_route(self, context, route):
     return routes.create_route(context, route)