Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GCU test_dynamic_acl failure on 2vlan config testbed #16637

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ZhaohuiS
Copy link
Contributor

@ZhaohuiS ZhaohuiS commented Jan 22, 2025

Description of PR

Summary:
Fixes # (issue)

  1. 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.

  2. 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 case

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

  1. With 2vlan config on testbed, such as t0-118, by default, ipv4 range for vlan1000 is 192.168.0.1/25 and ipv4 range for vlan2000 192.168.0.129/25, so set increment to 65.

Otherwise, incrementing by 129 will cause IP overlap within the second VLAN's IP range, 192.168.0.129.

      two_vlan_a:
        Vlan1000:
          id: 1000
          intfs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62]
          prefix: 192.168.0.1/25
          prefix_v6: fc02:1000::1/64
          tag: 1000
        Vlan2000:
          id: 2000
          intfs: [63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117]
          prefix: 192.168.0.129/25
          prefix_v6: fc02:1000:0:1::1/64
          tag: 2000
  1. Get the ipv4 or ipv6 address for specific vlan interface from configuration.

How did you do it?

  1. For vlan 1000, 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)

  1. Parse ipv4 or ipv6 address from config_facts['VLAN_INTERFACE'][vlan_name], different vlan_name will get differnet ip address

How 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

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ZhaohuiS ZhaohuiS requested a review from StormLiangMS January 22, 2025 08:18
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants