Skip to content

Implementation of multi-DUT and multi-ASIC as per PR 2347#2417

Merged
wangxin merged 6 commits intosonic-net:masterfrom
sanmalho-git:multi_dut
Oct 30, 2020
Merged

Implementation of multi-DUT and multi-ASIC as per PR 2347#2417
wangxin merged 6 commits intosonic-net:masterfrom
sanmalho-git:multi_dut

Conversation

@sanmalho-git
Copy link
Contributor

\u2026 testing support

Description of PR

Summary:
This is implementation of PR 2347 that described enhancements to support multi-asic and multi-dut

Type of change

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

Approach

What is the motivation for this PR?

PR sonic-net/SONiC#644 introduced the HLD to support multi ASIC. In the future, multi DUT or Chassis will be supported by SONiC as well. The test infrastructure and some of the customized ansible modules need to be updated to support testing of the upcoming new architectures. This PR is implementation of PR 2347 which tried to propose how to improve the current test infrastructure to support multi-DUT and multi-ASIC systems. The target is to ensure that the existing test scripts are not broken and we can update the tests in incremental way.

How did you do it?

Implemented the proposed classes in PR 2347.

Added the classes described in the PR:

  • SonicAsic - represents an asic, and implements the asic/namespace related operations to hide the complexity of handling the asic/namespace specific details.

    • For now, have added bgp_facts as an example to add 'instance_id' to the bgp_facts module call on a SonicHost.
  • MutliAsicSonicHost - a host with one or more SonicAsics.

  • DutHosts - represents all the DUT's in a testbed.

    • has 'nodes' list to represent each DUT in the testbed.
  • Update duthosts fixture to return an instance of DutHosts instead of a list of SonicHosts

  • Modify duthost fixture to return a MultiAsicSonicHost from duthosts.nodes

How did you verify/test it?

Using the newly added classes, tried out bgp_facts ansible module against:

  • single asic pizza box.
  • multi-asic pizza box
  • single asic multi dut (chassis with linecards that have a single asic).
  • multi-asic multi-dut (chassis with linecards that have multiple asics).

Tested following scenarios were tested against the 4 testbed DUT's above. In the scenarios - duthosts represents a DutHosts instance. Tested with 'command' ansible module (a module that is not impacted by multi-asic), and bgp_facts (a module that has to handle differences for multi-asic)

# Send command on the global / host namespace on all the nodes (duts)
# Return is a dictionary with key being the hostname, and value being output of  ansible module 'cat /etc/sonic/config_db.json'
cmd_out = duthosts.nodes.command("cat /etc/sonic/config_db.json")

# Get bgp_facts for all the asics of all the frontend nodes (nodes/duts with frontpanel ports):
# Return is a dictionary with key being the hostname, and the value being a list of bgp_facts output per asic.
# Even a single asic node would have its value as a list of size 1.
bgp_facts = duthosts.frontend_nodes.bgp_facts(asic_index='all')

# Get bgp_facts for asic0 of all the frontend nodes (nodes/duts with frontpanel ports):
# Return is a dictionary with key being the hostname, and the value being output of bgp_facts ansible module for asic0 on the node.
# For single asic, this would be the output of bgp_facts on global namespace.
bgp_facts_asic0 = duthosts.frontend_nodes.bgp_facts(asic_index=0)

# Get command output on the first node.
# Return is output of the command ansible module in the global namespace.
duthost = duthosts[0]
cmd_out_dut = duthost.command("cat /etc/sonic/config_db.json")

# Get bgp_facts on the first node across all asics. 
# Return is a list of bgp_facts for all asics. For single asic, this will be a list of size 1.
# For single asic node, this would be a list of size 1.
bgp_facts_dut = duthost.bgp_facts(asic_index='all')

# Get bgp_facts on the first asic on the first node.
# Return is the bgp_facts for asic0. For single asic, this will be bgp_facts on the global/host namespace.
bgp_facts_asic0_dut = duthost.bgp_facts(asic_index=0)

Any platform specific information?

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

Documentation

@lgtm-com
Copy link

lgtm-com bot commented Oct 27, 2020

This pull request introduces 3 alerts when merging bc0822d74306a3728b71f48eab59d0377da9f458 into 553e9ff - view on LGTM.com

new alerts:

  • 1 for __eq__ not overridden when adding attributes
  • 1 for Unnecessary pass
  • 1 for Unused import

@lguohan lguohan requested a review from wangxin October 27, 2020 22:31
@wangxin wangxin requested review from a team and arlakshm October 28, 2020 08:00
@lgtm-com
Copy link

lgtm-com bot commented Oct 28, 2020

This pull request introduces 3 alerts when merging b76cacb7d58d33381b990a0f0d8029b323d7db9a into 928ebb3 - view on LGTM.com

new alerts:

  • 1 for __eq__ not overridden when adding attributes
  • 1 for Inconsistent equality and inequality
  • 1 for Inconsistent equality and hashing

@wangxin
Copy link
Collaborator

wangxin commented Oct 29, 2020

@sanmalho-git The last commit looks good to me. This PR would be perfect if you could:

  • Address the LGTM alerts.
  • Move the comment of the method functions to docstring. Because this is very basic infrastructure code that will be used by people developing test cases, well written docstring could be documentations for them.
  • Handle the merge conflicts.

… testing support

- Added the classes described in the PR:
  - SonicAsic - represents an asic, and implements the asic/namespace related operations to hide the complexity of handling the asic/namespace specific details.
      - For now, have added bgp_facts as an example to add 'instance_id' to the bgp_facts module call on a SonicHost.
  - MutliAsicSonicHost - a host with one or more SonicAsics.
  - DutHosts - represents all the DUT's in a testbed.
      - has 'nodes' list to represent each DUT in the testbed.

- Update duthosts fixture to return an instance of DutHosts instead of a list of SonicHosts
- Modify duthost fixture to return a MultiAsicSonicHost from duthosts.nodes
… testing support

- Added the classes described in the PR:
  - SonicAsic - represents an asic, and implements the asic/namespace related operations to hide the complexity of handling the asic/namespace specific details.
      - For now, have added bgp_facts as an example to add 'instance_id' to the bgp_facts module call on a SonicHost.
  - MutliAsicSonicHost - a host with one or more SonicAsics.
  - DutHosts - represents all the DUT's in a testbed.
      - has 'nodes' list to represent each DUT in the testbed.

- Update duthosts fixture to return an instance of DutHosts instead of a list of SonicHosts
- Modify duthost fixture to return a MultiAsicSonicHost from duthosts.nodes
@lgtm-com
Copy link

lgtm-com bot commented Oct 29, 2020

This pull request introduces 3 alerts when merging 09ae617 into 38fe987 - view on LGTM.com

new alerts:

  • 1 for __eq__ not overridden when adding attributes
  • 1 for Inconsistent equality and inequality
  • 1 for Inconsistent equality and hashing

@lgtm-com
Copy link

lgtm-com bot commented Oct 29, 2020

This pull request introduces 2 alerts when merging 0c5a647 into 38fe987 - view on LGTM.com

new alerts:

  • 2 for Special method has incorrect signature

Copy link
Collaborator

@wangxin wangxin left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!

@wangxin
Copy link
Collaborator

wangxin commented Oct 30, 2020

retest this please

@wangxin wangxin merged commit f5b414d into sonic-net:master Oct 30, 2020
@sanmalho-git
Copy link
Contributor Author

@wangxin and @arlakshm - Thanks for the guidance for this PR. This is very critical to support SONiC Chassis testing going forward

@sanmalho-git sanmalho-git deleted the multi_dut branch October 30, 2020 14:48
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…#12292)

linkmgrd:
* a5ac7f6 2022-10-05 | [Active-Active] Post link prober stats to state db  (sonic-net#140) (HEAD -> 202205, github/202205) [Jing Zhang]
* f4b0e53 2022-10-05 | [Active-Active] Retry config mux mode standby (sonic-net#139) [Jing Zhang]

utilities:
* a255838 2022-10-04 | [minigraph] new workflow for golden path (sonic-net#2396) (HEAD -> 202205, github/202205) [jingwenxie]
* 99425a8 2022-10-03 | [actions] Support Semgrep by Github Actions (sonic-net#2417) [Mai Bui]
* f41e4d1 2022-09-30 | Fix for show vxlan tunnel command display issue sonic-net#11902 (sonic-net#2391) [Senthil Bhava]
* e1d827e 2022-09-29 | [VxLAN]Fix Vxlan delete command to throw error when there are references (sonic-net#2404) [Sudharsan Dhamal Gopalarathnam]
* d77acf8 2022-09-28 | [doc] add documentation on automatic techsupport based on memory (sonic-net#2411) [Stepan Blyshchak]
* 2cfc75a 2022-09-28 | [doc] update "config feature" section with "--block" option (sonic-net#2409) [Stepan Blyshchak]
* 9dc8471 2022-09-28 | [Vxlanmgrd] [CPA] Update the vxlan_tunnel name len to be under IFNAMIZ to overcome netdev creation failure (sonic-net#2398) [Vivek]
* 342589e 2022-10-03 | Added cisco config platform commands (sonic-net#2242) (sonic-net#2418) [yucgu]

swss:
* 9d9f395 2022-10-04 | [intfmgr]: Enable `accept_untracked_na` kernel param (sonic-net#2436) (HEAD -> 202205, github/202205) [Lawrence Lee]
* 6b6d25d 2022-10-04 |  [orchdaemon]: Fixed sairedis record file rotation (sonic-net#2480) [Bryan Crossland]

Signed-off-by: Ying Xie <[email protected]>

Signed-off-by: Ying Xie <[email protected]>
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