Default subnet-prefix-length should be consistent
Changed default_subnet_prefix_length from "default=26"
to "default=24" in implicit_policy.ini and implicit_policy.py
for consistency.
Updated relevant unit tests.
Closes-Bug: #1489981
Change-Id: I2356191b4de2e182e27a6070791e3c57a6db80c8
(cherry picked from commit a6c5f78630)
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
# polices, controlling size of subnets allocated for
|
# polices, controlling size of subnets allocated for
|
||||||
# policy target groups.
|
# policy target groups.
|
||||||
|
|
||||||
# default_subnet_prefix_length = 26
|
# default_subnet_prefix_length = 24
|
||||||
|
|
||||||
# Name of default External Segment. This will be used
|
# Name of default External Segment. This will be used
|
||||||
# whenever a new EP/L3P is created without a referenced
|
# whenever a new EP/L3P is created without a referenced
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ opts = [
|
|||||||
"from which subnets are allocated for policy target "
|
"from which subnets are allocated for policy target "
|
||||||
"groups.")),
|
"groups.")),
|
||||||
cfg.IntOpt('default_subnet_prefix_length',
|
cfg.IntOpt('default_subnet_prefix_length',
|
||||||
default=26,
|
default=24,
|
||||||
help=_("Subnet prefix length for implicitly created default L3 "
|
help=_("Subnet prefix length for implicitly created default L3 "
|
||||||
"polices, controlling size of subnets allocated for "
|
"polices, controlling size of subnets allocated for "
|
||||||
"policy target groups.")),
|
"policy target groups.")),
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ class TestGroupResources(GroupPolicyDbTestCase):
|
|||||||
ctx = context.get_admin_context()
|
ctx = context.get_admin_context()
|
||||||
data = {'l3_policy': {'name': 'l3p1', 'ip_version': 4,
|
data = {'l3_policy': {'name': 'l3p1', 'ip_version': 4,
|
||||||
'description': '', 'ip_pool': '0.0.0.0/0',
|
'description': '', 'ip_pool': '0.0.0.0/0',
|
||||||
'subnet_prefix_length': 26}}
|
'subnet_prefix_length': 24}}
|
||||||
|
|
||||||
self.assertRaises(gpolicy.InvalidIpPoolPrefixLength,
|
self.assertRaises(gpolicy.InvalidIpPoolPrefixLength,
|
||||||
self.plugin.create_l3_policy, ctx, data)
|
self.plugin.create_l3_policy, ctx, data)
|
||||||
@@ -533,7 +533,7 @@ class TestGroupResources(GroupPolicyDbTestCase):
|
|||||||
def test_update_l3_policy(self):
|
def test_update_l3_policy(self):
|
||||||
name = "new_l3_policy"
|
name = "new_l3_policy"
|
||||||
description = 'new desc'
|
description = 'new desc'
|
||||||
prefix_length = 26
|
prefix_length = 24
|
||||||
es = self.create_external_segment()['external_segment']
|
es = self.create_external_segment()['external_segment']
|
||||||
es_dict = {es['id']: ['172.16.0.2', '172.16.0.3']}
|
es_dict = {es['id']: ['172.16.0.2', '172.16.0.3']}
|
||||||
attrs = cm.get_create_l3_policy_default_attrs(
|
attrs = cm.get_create_l3_policy_default_attrs(
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ class TestImplicitL3Policy(ImplicitPolicyTestCase):
|
|||||||
l3p = self.deserialize(self.fmt, req.get_response(self.ext_api))
|
l3p = self.deserialize(self.fmt, req.get_response(self.ext_api))
|
||||||
self.assertEqual('default', l3p['l3_policy']['name'])
|
self.assertEqual('default', l3p['l3_policy']['name'])
|
||||||
self.assertEqual(shared, l3p['l3_policy']['shared'])
|
self.assertEqual(shared, l3p['l3_policy']['shared'])
|
||||||
|
self.assertEqual(24, l3p['l3_policy']['subnet_prefix_length'])
|
||||||
|
|
||||||
# Create 2nd L2 policy sharing implicit L3 policy.
|
# Create 2nd L2 policy sharing implicit L3 policy.
|
||||||
l2p2 = self.create_l2_policy()
|
l2p2 = self.create_l2_policy()
|
||||||
|
|||||||
Reference in New Issue
Block a user