Skip to content

[multi-asic fix] fix new change in test_route_perf.py to support multi-asic#15452

Merged
arlakshm merged 4 commits intosonic-net:masterfrom
wenyiz2021:route_perf
Nov 11, 2024
Merged

[multi-asic fix] fix new change in test_route_perf.py to support multi-asic#15452
arlakshm merged 4 commits intosonic-net:masterfrom
wenyiz2021:route_perf

Conversation

@wenyiz2021
Copy link
Copy Markdown
Contributor

@wenyiz2021 wenyiz2021 commented Nov 7, 2024

Description of PR

Summary:
Fixes # (issue)
for multi-asic devices, when asic is broadcom, using "bcmcmd" needs to specify asic id.

TODO:
depending on type of asic, e.g. xgs/dnx, we need to confirm with broadcom if the asic supports "conf show l3_alpm_enable" command, if not, skip for that platform.

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?

How did you verify/test it?

Any platform specific information?

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

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

@arista-nwolfe arista-nwolfe left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this

@mssonicbld
Copy link
Copy Markdown
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/route/test_route_perf.py:68:121: E501 line too long (122 > 120 characters)

flake8...............................................(no files to check)Skipped
check conditional mark sort..............................................Passed

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@wenyiz2021
Copy link
Copy Markdown
Contributor Author

@arlakshm @judyjoseph can you help merge?

@arlakshm arlakshm merged commit 91ea307 into sonic-net:master Nov 11, 2024
@wenyiz2021 wenyiz2021 deleted the route_perf branch November 12, 2024 23:26
@wenyiz2021
Copy link
Copy Markdown
Contributor Author

@yejianquan can you help backport this PR to 202405? thanks

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 14, 2024
…i-asic (sonic-net#15452)

Description of PR
Summary:
Fixes # (issue)
for multi-asic devices, when asic is broadcom, using "bcmcmd" needs to specify asic id.
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202405: #15557

mssonicbld pushed a commit that referenced this pull request Nov 14, 2024
…i-asic (#15452)

Description of PR
Summary:
Fixes # (issue)
for multi-asic devices, when asic is broadcom, using "bcmcmd" needs to specify asic id.
sreejithsreekumaran pushed a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Nov 15, 2024
…i-asic (sonic-net#15452)

Description of PR
Summary:
Fixes # (issue)
for multi-asic devices, when asic is broadcom, using "bcmcmd" needs to specify asic id.
@lolyu
Copy link
Copy Markdown
Collaborator

lolyu commented Nov 19, 2024

This is causing regression on dualtor, @wenyiz2021, could you please help check/fix the following failure?

enum_rand_one_frontend_asic_index = None
tbinfo = {'auto_recover': 'True', 'comment': 'v-saidia', 'conf-name': 'vms21-dual-t0-7260', 'duts': ['str2-7260cx3-acs-10', 'str2-7260cx3-acs-11'], ...}

    @pytest.fixture
    def check_config(duthosts, enum_rand_one_per_hwsku_frontend_hostname, enum_rand_one_frontend_asic_index, tbinfo):
        if tbinfo["topo"]["type"] in ["m0", "mx"]:
            return
    
        duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
        asic = duthost.facts["asic_type"]
        asic_id = enum_rand_one_frontend_asic_index
    
        if (asic == "broadcom"):
            broadcom_cmd = "bcmcmd -n " + str(asic_id) if duthost.is_multi_asic else "bcmcmd"
            alpm_cmd = "{} {}".format(broadcom_cmd, "conf show l3_alpm_enable")
            alpm_enable = duthost.command(alpm_cmd)["stdout_lines"][2].strip()
            logger.info("Checking config: {}".format(alpm_enable))
>           pytest_assert(alpm_enable == "l3_alpm_enable=2", "l3_alpm_enable is not set for route scaling")
E           Failed: l3_alpm_enable is not set for route scaling

@arista-nwolfe
Copy link
Copy Markdown
Contributor

This is causing regression on dualtor, @wenyiz2021, could you please help check/fix the following failure?

enum_rand_one_frontend_asic_index = None
tbinfo = {'auto_recover': 'True', 'comment': 'v-saidia', 'conf-name': 'vms21-dual-t0-7260', 'duts': ['str2-7260cx3-acs-10', 'str2-7260cx3-acs-11'], ...}

    @pytest.fixture
    def check_config(duthosts, enum_rand_one_per_hwsku_frontend_hostname, enum_rand_one_frontend_asic_index, tbinfo):
        if tbinfo["topo"]["type"] in ["m0", "mx"]:
            return
    
        duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
        asic = duthost.facts["asic_type"]
        asic_id = enum_rand_one_frontend_asic_index
    
        if (asic == "broadcom"):
            broadcom_cmd = "bcmcmd -n " + str(asic_id) if duthost.is_multi_asic else "bcmcmd"
            alpm_cmd = "{} {}".format(broadcom_cmd, "conf show l3_alpm_enable")
            alpm_enable = duthost.command(alpm_cmd)["stdout_lines"][2].strip()
            logger.info("Checking config: {}".format(alpm_enable))
>           pytest_assert(alpm_enable == "l3_alpm_enable=2", "l3_alpm_enable is not set for route scaling")
E           Failed: l3_alpm_enable is not set for route scaling

I think @vivekverma-arista has a fix for this:
#15620

yejianquan pushed a commit that referenced this pull request Nov 20, 2024
Description of PR
Summary:
Fixes #323

Approach
What is the motivation for this PR?
Regression due to #15452

How did you do it?
Added missing quotes to the command.

How did you verify/test it?
Ran route/test_route_perf.py on Arista 7260CX3 platform with dualtor topology.

co-authorized by: jianquanye@microsoft.com
yutongzhang-microsoft pushed a commit to yutongzhang-microsoft/sonic-mgmt that referenced this pull request Nov 21, 2024
…i-asic (sonic-net#15452)

Description of PR
Summary:
Fixes # (issue)
for multi-asic devices, when asic is broadcom, using "bcmcmd" needs to specify asic id.
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 21, 2024
Description of PR
Summary:
Fixes sonic-net#323

Approach
What is the motivation for this PR?
Regression due to sonic-net#15452

How did you do it?
Added missing quotes to the command.

How did you verify/test it?
Ran route/test_route_perf.py on Arista 7260CX3 platform with dualtor topology.

co-authorized by: jianquanye@microsoft.com
StormLiangMS pushed a commit that referenced this pull request Nov 26, 2024
Description of PR
Summary:
Fixes #323

Approach
What is the motivation for this PR?
Regression due to #15452

How did you do it?
Added missing quotes to the command.

How did you verify/test it?
Ran route/test_route_perf.py on Arista 7260CX3 platform with dualtor topology.

co-authorized by: jianquanye@microsoft.com

Co-authored-by: Vivek Verma <137406113+vivekverma-arista@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants