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

[action] [PR:14673] feat: add multi-asic in test_cont_link_flap #14726

Open
wants to merge 1 commit into
base: 202405
Choose a base branch
from

Conversation

mssonicbld
Copy link
Collaborator

Description of PR

Currently, test_cont_link_flap is not compatible with multi-asic. It's failing on vtysh command

 raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res)
tests.common.errors.RunAnsibleModuleFail: run module shell failed, Ansible Results =>
{"changed": true, "cmd": "vtysh -c \"show memory bgpd\"", "delta": "0:00:00.006507", "end": "2024-09-17 00:06:50.914882", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2024-09-17 00:06:50.908375", "stderr": "Usage: /usr/bin/vtysh -n [0 to 2] [OPTION]... ", "stderr_lines": ["Usage: /usr/bin/vtysh -n [0 to 2] [OPTION]... "], "stdout": "", "stdout_lines": []}

This is because for multi-asic platform, we need to specify -n.

Summary: add multi-asic support for test_cont_link_flap
Fixes # (issue) 2954952

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?

Support multi-asic for test_cont_link_flap by calculating the memory based of each individual asic

How did you do it?

Since SonicAsic.run_asic has already provided a back-ward compatible to multi-asic and single-asic (https://github.com/sonic-net/sonic-mgmt/blob/master/tests/common/devices/sonic_asic.py#L404) we can leverage this API to execute the test.

The test is also working with single-asic since in our system, single-asic chassis will have 1 asic with namespace=None and asic-index=0

How did you verify/test it?

Verified on T2 device and T0 kms

Any platform specific information?

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

Documentation

Description of PR
Currently, test_cont_link_flap is not compatible with multi-asic. It's failing on vtysh command

    raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res)
tests.common.errors.RunAnsibleModuleFail: run module shell failed, Ansible Results =>
{"changed": true, "cmd": "vtysh -c \"show memory bgpd\"", "delta": "0:00:00.006507", "end": "2024-09-17 00:06:50.914882", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2024-09-17 00:06:50.908375", "stderr": "Usage: /usr/bin/vtysh -n [0 to 2] [OPTION]... ", "stderr_lines": ["Usage: /usr/bin/vtysh -n [0 to 2] [OPTION]... "], "stdout": "", "stdout_lines": []}
This is because for multi-asic platform, we need to specify -n.

Summary: add multi-asic support for test_cont_link_flap
Fixes # (issue) 2954952

Approach
What is the motivation for this PR?
Support multi-asic for test_cont_link_flap by calculating the memory based of each individual asic

How did you do it?
Since SonicAsic.run_asic has already provided a back-ward compatible to multi-asic and single-asic (https://github.com/sonic-net/sonic-mgmt/blob/master/tests/common/devices/sonic_asic.py#L404) we can leverage this API to execute the test.

The test is also working with single-asic since in our system, single-asic chassis will have 1 asic with namespace=None and asic-index=0

How did you verify/test it?
Verified on T2 device and T0 kms

Signed-off-by: Austin Pham <austinpham@microsoft.com>
@mssonicbld
Copy link
Collaborator Author

Original PR: #14673

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.

2 participants