self._setup_subnet_mocks()
super(TestMidonetSubnetsV2, self).test_create_subnet_gw_values()
- def test_create_force_subnet_gw_values(self):
+ def test_create_subnet_gw_outside_cidr_force_on_returns_400(self):
self._setup_subnet_mocks()
- super(TestMidonetSubnetsV2, self).test_create_force_subnet_gw_values()
+ super(TestMidonetSubnetsV2,
+ self).test_create_subnet_gw_outside_cidr_force_on_returns_400()
+
+ def test_create_subnet_gw_of_network_force_on_returns_400(self):
+ self._setup_subnet_mocks()
+ super(TestMidonetSubnetsV2,
+ self).test_create_subnet_gw_of_network_force_on_returns_400()
+
+ def test_create_subnet_gw_bcast_force_on_returns_400(self):
+ self._setup_subnet_mocks()
+ super(TestMidonetSubnetsV2,
+ self).test_create_subnet_gw_bcast_force_on_returns_400()
def test_create_subnet_with_allocation_pool(self):
self._setup_subnet_mocks()
super(TestMidonetSubnetsV2,
self).test_update_subnet_shared_returns_400()
+ def test_update_subnet_gw_outside_cidr_force_on_returns_400(self):
+ pass
+
def test_update_subnet_inconsistent_ipv4_gatewayv6(self):
pass
self._test_create_subnet(expected=expected,
gateway_ip=gateway)
- def test_create_force_subnet_gw_values(self):
+ def test_create_subnet_gw_outside_cidr_force_on_returns_400(self):
cfg.CONF.set_override('force_gateway_on_subnet', True)
with self.network() as network:
self._create_subnet(self.fmt,
400,
gateway_ip='100.0.0.1')
+ def test_create_subnet_gw_of_network_force_on_returns_400(self):
+ cfg.CONF.set_override('force_gateway_on_subnet', True)
+ with self.network() as network:
+ self._create_subnet(self.fmt,
+ network['network']['id'],
+ '10.0.0.0/24',
+ 400,
+ gateway_ip='10.0.0.0')
+
+ def test_create_subnet_gw_bcast_force_on_returns_400(self):
+ cfg.CONF.set_override('force_gateway_on_subnet', True)
+ with self.network() as network:
+ self._create_subnet(self.fmt,
+ network['network']['id'],
+ '10.0.0.0/24',
+ 400,
+ gateway_ip='10.0.0.255')
+
def test_create_subnet_with_allocation_pool(self):
gateway_ip = '10.0.0.1'
cidr = '10.0.0.0/24'
res = req.get_response(self.api)
self.assertEqual(res.status_int, 400)
+ def test_update_subnet_gw_outside_cidr_force_on_returns_400(self):
+ cfg.CONF.set_override('force_gateway_on_subnet', True)
+ with self.network() as network:
+ with self.subnet(network=network) as subnet:
+ data = {'subnet': {'gateway_ip': '100.0.0.1'}}
+ req = self.new_update_request('subnets', data,
+ subnet['subnet']['id'])
+ res = req.get_response(self.api)
+ self.assertEqual(res.status_int, 400)
+
def test_update_subnet_inconsistent_ipv4_gatewayv6(self):
with self.network() as network:
with self.subnet(network=network) as subnet: