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 acl/test_stress_acl.py invalid interface name #15796

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

justin-wong-ce
Copy link
Contributor

Description of PR

Fix acl/test_stress_acl.py using bad interface name for ACL table creation

Summary:
Fixes # (issue)
In acl/test_stress_acl.py, it attempts to retrieve an interface that can be used to create a ACL table. DUTs with and without PortChannels require different methods respectively.

Currently, it checks by filtering with topo. However, some topology flags can have configurations that have or not have PortChannels, making topos no longer a sufficient check - in some topos the test will fail with:

Error: Failed to parse ACL table config: exception=Cannot bind ACL to specified port Ethernet136

Reproducible by manually running the following on the DUT:

config acl add table DATAACL L3 -s ingress -p Ethernet0
^FAILS
config acl add table DATAACL L3 -s ingress -p PortChannel101
^WORKS

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

How did you do it?

Fix by checking if a PortChannel exists. If it does - use it. If it does not - fallback on the secondary method to retrieve a normal interface name if its a not a dualtor topo (due to
#6960).

How did you verify/test it?

Test no longer fails creating an ACL table on a t1 topo with PortChannels.
Tested with Arista HwSkus on t0, t1, t2, and mx topologies.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

creation

In `acl/test_stress_acl.py`, it attempts to retrieve an interface that
can be used to create a ACL table. DUTs with and without PortChannels
require different methods respectively.

Currently, it checks by filtering with topo. However, some topology
flags can have configurations that have or not have PortChannels, making
topos no longer a sufficient check.

Fix by checking if a PortChannel exists. If it does - use it. If it does
not - fallback on the secondary method to retrieve a normal interface
name if its a not a dualtor topo (due to
sonic-net#6960).
@justin-wong-ce justin-wong-ce changed the title Acl stress fix Fix acl/test_stress_acl.py invalid interface name Nov 28, 2024
@StormLiangMS
Copy link
Collaborator

hi @bingwang-ms could you help to take a look?

StormLiangMS
StormLiangMS previously approved these changes Dec 5, 2024
Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bingwang-ms
Copy link
Collaborator

@justin-wong-ce Can you help me understand why there is no portchannel for test on dualtor platform?

@justin-wong-ce
Copy link
Contributor Author

justin-wong-ce commented Dec 5, 2024

@justin-wong-ce Can you help me understand why there is no portchannel for test on dualtor platform?

I decided to handle dualtor differently because of this previous pull request: #6960:

What is the motivation for this PR?
In acl stress test, ACL table creation can be failed on dualtor platform because of insufficient resources
The test case only add/delete a same rule, which is not the real scenario in production

I am not too familiar with PortChannels on dualtor but I think sometimes it is not available based on the PR adding dualtor support to the test.

@bingwang-ms
Copy link
Collaborator

@justin-wong-ce Can you help me understand why there is no portchannel for test on dualtor platform?

I decided to handle dualtor differently because of this previous pull request: #6960:

What is the motivation for this PR?
In acl stress test, ACL table creation can be failed on dualtor platform because of insufficient resources
The test case only add/delete a same rule, which is not the real scenario in production

I am not too familiar with PortChannels on dualtor but I think sometimes it is not available based on the PR adding dualtor support to the test.

Thanks for the reply. Portchannels should always be available on dualtor platform.
@xwjiang-ms Can you please help review & comment?

xwjiang-ms

This comment was marked as resolved.

As discussed in PR conversation, there is no need for dualtor to have
any special checks. Generalizing the checks for all topos.
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StormLiangMS StormLiangMS merged commit 57ec10d into sonic-net:master Dec 19, 2024
16 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Dec 19, 2024
Description of PR
Fix acl/test_stress_acl.py using bad interface name for ACL table creation

Summary:
Fixes # (issue)
In acl/test_stress_acl.py, it attempts to retrieve an interface that can be used to create a ACL table. DUTs with and without PortChannels require different methods respectively.

Currently, it checks by filtering with topo. However, some topology flags can have configurations that have or not have PortChannels, making topos no longer a sufficient check - in some topos the test will fail with:

Error: Failed to parse ACL table config: exception=Cannot bind ACL to specified port Ethernet136
Reproducible by manually running the following on the DUT:

config acl add table DATAACL L3 -s ingress -p Ethernet0
^FAILS
config acl add table DATAACL L3 -s ingress -p PortChannel101
^WORKS
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Dec 19, 2024
Description of PR
Fix acl/test_stress_acl.py using bad interface name for ACL table creation

Summary:
Fixes # (issue)
In acl/test_stress_acl.py, it attempts to retrieve an interface that can be used to create a ACL table. DUTs with and without PortChannels require different methods respectively.

Currently, it checks by filtering with topo. However, some topology flags can have configurations that have or not have PortChannels, making topos no longer a sufficient check - in some topos the test will fail with:

Error: Failed to parse ACL table config: exception=Cannot bind ACL to specified port Ethernet136
Reproducible by manually running the following on the DUT:

config acl add table DATAACL L3 -s ingress -p Ethernet0
^FAILS
config acl add table DATAACL L3 -s ingress -p PortChannel101
^WORKS
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #16155

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Dec 19, 2024
Description of PR
Fix acl/test_stress_acl.py using bad interface name for ACL table creation

Summary:
Fixes # (issue)
In acl/test_stress_acl.py, it attempts to retrieve an interface that can be used to create a ACL table. DUTs with and without PortChannels require different methods respectively.

Currently, it checks by filtering with topo. However, some topology flags can have configurations that have or not have PortChannels, making topos no longer a sufficient check - in some topos the test will fail with:

Error: Failed to parse ACL table config: exception=Cannot bind ACL to specified port Ethernet136
Reproducible by manually running the following on the DUT:

config acl add table DATAACL L3 -s ingress -p Ethernet0
^FAILS
config acl add table DATAACL L3 -s ingress -p PortChannel101
^WORKS
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #16156

mssonicbld pushed a commit that referenced this pull request Dec 19, 2024
Description of PR
Fix acl/test_stress_acl.py using bad interface name for ACL table creation

Summary:
Fixes # (issue)
In acl/test_stress_acl.py, it attempts to retrieve an interface that can be used to create a ACL table. DUTs with and without PortChannels require different methods respectively.

Currently, it checks by filtering with topo. However, some topology flags can have configurations that have or not have PortChannels, making topos no longer a sufficient check - in some topos the test will fail with:

Error: Failed to parse ACL table config: exception=Cannot bind ACL to specified port Ethernet136
Reproducible by manually running the following on the DUT:

config acl add table DATAACL L3 -s ingress -p Ethernet0
^FAILS
config acl add table DATAACL L3 -s ingress -p PortChannel101
^WORKS
mssonicbld pushed a commit that referenced this pull request Dec 28, 2024
Description of PR
Fix acl/test_stress_acl.py using bad interface name for ACL table creation

Summary:
Fixes # (issue)
In acl/test_stress_acl.py, it attempts to retrieve an interface that can be used to create a ACL table. DUTs with and without PortChannels require different methods respectively.

Currently, it checks by filtering with topo. However, some topology flags can have configurations that have or not have PortChannels, making topos no longer a sufficient check - in some topos the test will fail with:

Error: Failed to parse ACL table config: exception=Cannot bind ACL to specified port Ethernet136
Reproducible by manually running the following on the DUT:

config acl add table DATAACL L3 -s ingress -p Ethernet0
^FAILS
config acl add table DATAACL L3 -s ingress -p PortChannel101
^WORKS
@justin-wong-ce justin-wong-ce deleted the acl-stress-fix branch January 24, 2025 20:33
@nhe-NV
Copy link
Contributor

nhe-NV commented Feb 14, 2025

@r12f This PR also needed for the 202412 branch, can you help to merge it also to 202412 branch?

@r12f
Copy link
Contributor

r12f commented Feb 18, 2025

already included in 202411, removing 202412 tag.

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

Successfully merging this pull request may close these issues.

8 participants