Skip to content

Fix the hardcoded interface issue in PTF#17965

Merged
StormLiangMS merged 1 commit intosonic-net:masterfrom
LinJin23:fix-acl
May 15, 2025
Merged

Fix the hardcoded interface issue in PTF#17965
StormLiangMS merged 1 commit intosonic-net:masterfrom
LinJin23:fix-acl

Conversation

@LinJin23
Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Replace hardcoded value (0, 0) in ACL test with a dynamic selection to improve robustness across diverse topologies.

Fixes:
The hardcoded value (0, 0) does not account for scenarios where device_number or port_number is not 0, which causes failures in certain topologies.

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?

When running nightly tests using the t2_single_node_min topology, we encountered failures in the ACL test. The root cause was a hardcoded call to get_mac(0, 0), which assumes that a device with device_number = 0 and port_number = 0 exists. This assumption does not hold true in some topologies like t2_single_node_min.

How did you do it?

Instead of using the hardcoded (0, 0) port index, this PR dynamically selects the first available port from the existing list of ports. This improves compatibility and prevents test failures across topologies with varying port configurations.

How did you verify/test it?

Tested locally by running acl/test_acl.py against the t2_single_node_min topology and confirmed that the tests pass successfully.

Any platform specific information?

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

Documentation

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Apr 11, 2025

CLA Missing ID CLA Not Signed

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@arlakshm
Copy link
Copy Markdown
Contributor

@arista-nwolfe, @kenneth-arista for viz..

@arlakshm
Copy link
Copy Markdown
Contributor

/Azp run Azure.sonic-mgmt

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@tjchadaga
Copy link
Copy Markdown
Contributor

@LinJin23 - please help make this change in all test modules where this hardcoding is done

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@LinJin23 LinJin23 changed the title fix acl on t2_single_node_min topology Fix the hardcoded interface issue in PTF reading May 14, 2025
@LinJin23 LinJin23 changed the title Fix the hardcoded interface issue in PTF reading Fix the hardcoded interface issue in PTF May 14, 2025
@LinJin23
Copy link
Copy Markdown
Contributor Author

Hi @yxieca and @wangxin , please help review this PR when you're available.

@LinJin23 LinJin23 requested a review from StormLiangMS May 15, 2025 02:55
Copy link
Copy Markdown
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 ca0fd8e into sonic-net:master May 15, 2025
20 checks passed
@StormLiangMS
Copy link
Copy Markdown
Collaborator

hi @LinJin23 could you check the cherrypick conflict? You may need to create a separate PR for cherrypick.

@LinJin23 LinJin23 self-assigned this May 22, 2025
auspham pushed a commit to auspham/sonic-mgmt that referenced this pull request May 30, 2025
…#286)

What is the motivation for this PR?
When running nightly tests using the t2_single_node_min topology, we
encountered failures in the ACL test. The root cause was a hardcoded
call to get_mac(0, 0), which assumes that a device with device_number =
0 and port_number = 0 exists. This assumption does not hold true in some
topologies like t2_single_node_min.

How did you do it?
Instead of using the hardcoded (0, 0) port index, this PR dynamically
selects the first available port from the existing list of ports. This
improves compatibility and prevents test failures across topologies with
varying port configurations.

How did you verify/test it?
Tested locally by running acl/test_acl.py against the t2_single_node_min
topology and confirmed that the tests pass successfully.
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
What is the motivation for this PR?
When running nightly tests using the t2_single_node_min topology, we encountered failures in the ACL test. The root cause was a hardcoded call to get_mac(0, 0), which assumes that a device with device_number = 0 and port_number = 0 exists. This assumption does not hold true in some topologies like t2_single_node_min.

How did you do it?
Instead of using the hardcoded (0, 0) port index, this PR dynamically selects the first available port from the existing list of ports. This improves compatibility and prevents test failures across topologies with varying port configurations.

How did you verify/test it?
Tested locally by running acl/test_acl.py against the t2_single_node_min topology and confirmed that the tests pass successfully.

Signed-off-by: opcoder0 <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
What is the motivation for this PR?
When running nightly tests using the t2_single_node_min topology, we encountered failures in the ACL test. The root cause was a hardcoded call to get_mac(0, 0), which assumes that a device with device_number = 0 and port_number = 0 exists. This assumption does not hold true in some topologies like t2_single_node_min.

How did you do it?
Instead of using the hardcoded (0, 0) port index, this PR dynamically selects the first available port from the existing list of ports. This improves compatibility and prevents test failures across topologies with varying port configurations.

How did you verify/test it?
Tested locally by running acl/test_acl.py against the t2_single_node_min topology and confirmed that the tests pass successfully.

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
What is the motivation for this PR?
When running nightly tests using the t2_single_node_min topology, we encountered failures in the ACL test. The root cause was a hardcoded call to get_mac(0, 0), which assumes that a device with device_number = 0 and port_number = 0 exists. This assumption does not hold true in some topologies like t2_single_node_min.

How did you do it?
Instead of using the hardcoded (0, 0) port index, this PR dynamically selects the first available port from the existing list of ports. This improves compatibility and prevents test failures across topologies with varying port configurations.

How did you verify/test it?
Tested locally by running acl/test_acl.py against the t2_single_node_min topology and confirmed that the tests pass successfully.

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
What is the motivation for this PR?
When running nightly tests using the t2_single_node_min topology, we encountered failures in the ACL test. The root cause was a hardcoded call to get_mac(0, 0), which assumes that a device with device_number = 0 and port_number = 0 exists. This assumption does not hold true in some topologies like t2_single_node_min.

How did you do it?
Instead of using the hardcoded (0, 0) port index, this PR dynamically selects the first available port from the existing list of ports. This improves compatibility and prevents test failures across topologies with varying port configurations.

How did you verify/test it?
Tested locally by running acl/test_acl.py against the t2_single_node_min topology and confirmed that the tests pass successfully.

Signed-off-by: Guy Shemesh <[email protected]>
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.

5 participants