Merge "Randomize second octet to avoid test vlan IP collision"

This commit is contained in:
Zuul
2025-06-27 11:50:41 +00:00
committed by Gerrit Code Review

View File

@@ -260,8 +260,9 @@ class VlanTransparencyWhiteboxBaseTest(base.BaseTempestTestCase):
while True:
vlan_tag = data_utils.rand_int_id(start=MIN_VLAN_ID,
end=MAX_VLAN_ID)
vlan_ipmask_template = '192.168.%d.{ip_last_byte}/24' % (
vlan_tag % 256)
vtag = vlan_tag % 256
vlan_ipmask_template = '192.%d.%d.{ip_last_byte}/24' % (vtag,
vtag)
if (vlan_tag not in vlan_tags and
vlan_ipmask_template not in vlan_ipmask_templates):
vlan_tags.append(vlan_tag)