Fix GCU test_dynamic_acl failure on 2vlan config testbed #16637
+20
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes # (issue)
failures of test_gcu_acl_arp_rule_creation when enabling 2 vlan config
With 2vlan config on testbed, GCU test_dynamic_acl failed due to ip conflict with the ip address of the second vlan interface,
192.168.0.129.
ping success, but there is no arp entry for this ip address.
Then case failed.
Failures of test_gcu_acl_dhcp_rule_creation when enabling 2 vlan config
Previous logic just picks up the latest ipv4 address or ipv6 address from
mg_facts['minigraph_vlan_interfaces']
, which doesn't work for the first vlan caseType of change
Back port request
Approach
What is the motivation for this PR?
Otherwise, incrementing by 129 will cause IP overlap within the second VLAN's IP range, 192.168.0.129.
How did you do it?
intf_ipv4_addr.network_address
is 192.168.0.0, after increase 129, it becomes 192.168.0.129, which is same with ip address of the second vlan interface.ptf_intf_ipv4_addr = increment_ipv4_addr(intf_ipv4_addr.network_address, incr=129)
config_facts['VLAN_INTERFACE'][vlan_name]
, differentvlan_name
will get differnet ip addressHow did you verify/test it?
run tests/generic_config_updater/test_dynamic_acl.py
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation