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

Introduce framework for filtering/selecting pluggable components for sonic modular chassis #2794

Merged
merged 6 commits into from Feb 11, 2021

Conversation

rawal01
Copy link
Contributor

@rawal01 rawal01 commented Jan 13, 2021

Introduce framework for filtering/selecting pluggable components for sonic modular chassis

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

Add test cases to verify show chassis-module status and show chassis-module midplane-status for VOQ chassis. The cli commands were introduced in following PRs:

How did you do it?

  1. Added new script tests/platform_tests/cli/test_show_chassis_module.py for verifying show chassis-module status and show chassis-module midplane status. Introduced test cases:
  • test_show_chassis_module_status: verify the output of command show chassis-module status
  • test_show_chassis_module_midplane_status: verify the output of command show chassis-module midplane-status
  1. Added new script test_power_budget_info.py for verifying the redis output for power budget policy in supervisor card of chassis
  2. Added a fixture that skips checking for modules for DUT. This new fixture is introduced to skips modules for DUT not present based on entries in inventory file, by default the test it is assumed the chassis is fully equipped and all modules are up. Example to skip certain modules add to skip modules in inventory for DUT:
DUT1
    skip_modules:
        'line-cards':
          - LINE-CARD0
          - LINE-CARD2
        'fabric-cards':
          - FABRIC-CARD3
        'psus':
          - PSU4
          - PSU5

Based on inventory file the tests will skip above modules for DUT1. For example, show chassis module will allow empty as status for LINE-CARD0 and LINE-CARD2 while all other will be expected to be ONLINE.

How did you verify/test it?

Ran sample tests against Nokia chassis with t2 topology using the skip fixture

Any platform specific information?

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

t2

Documentation

@rawal01 rawal01 changed the title Adding tests for new platform cli commands for VOQ Chassis Introduce framework for filtering/selecting pluggable components for sonic modular chassis Jan 13, 2021
@lgtm-com
Copy link

lgtm-com bot commented Jan 19, 2021

This pull request introduces 2 alerts when merging 761e55e into 823fe3d - view on LGTM.com

new alerts:

  • 2 for Unused import

@lguohan lguohan added this to In progress in Chassis via automation Jan 20, 2021
@rawal01
Copy link
Contributor Author

rawal01 commented Jan 21, 2021

retest vsimage please

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.

Can you address the LGTM alerts?

Chassis automation moved this from In progress to Reviewer approved Feb 2, 2021
@wangxin
Copy link
Collaborator

wangxin commented Feb 2, 2021

@rawal01 Can you update the PR description to match the latest code of this PR?

tests/platform_tests/cli/util.py Outdated Show resolved Hide resolved
tests/platform_tests/test_power_budget_info.py Outdated Show resolved Hide resolved
tests/platform_tests/test_power_budget_info.py Outdated Show resolved Hide resolved
 -adding new json file to support fixture in platform tests to skip checks for modules not present in DUT
new file:   tests/platform_tests/cli/test_show_chassis_module.py
  -adding new two new test cases for verifying show chassis-module status and show chassis-module midplane status introduced as part of
   PRs sonic-net/sonic-utilities#1145 and sonic-net/sonic-utilities#1267
tests/platform_tests/conftest.py
   -adding a fixture that skips checking for modules for DUT
changed method to fetch skip list from new json file to inventory based

tests/platform_tests/cli/util.py
new utility function to get skip modules list from inventory per dut hostname

tests/platform_tests/conftest.py
remove fixture to fetch skip module list based on json file

tests/platform_tests/test_power_budget_info.py
Add new test to test power budget redis command for chassis module
@rawal01
Copy link
Contributor Author

rawal01 commented Feb 3, 2021

@rawal01 Can you update the PR description to match the latest code of this PR?
@wangxin
updated description to remove reference to JSON file and updated fixture description

@wangxin
Copy link
Collaborator

wangxin commented Feb 3, 2021

@rawal01 Can you update the PR description to match the latest code of this PR?
@wangxin
updated description to remove reference to JSON file and updated fixture description

I have reformatted and updated your PR description a little bit. Could you check if it is accurate?

@rawal01
Copy link
Contributor Author

rawal01 commented Feb 11, 2021

@rawal01 Can you update the PR description to match the latest code of this PR?
@wangxin
updated description to remove reference to JSON file and updated fixture description

I have reformatted and updated your PR description a little bit. Could you check if it is accurate?

Looks good

@shubav
Copy link
Contributor

shubav commented Feb 11, 2021

@wangxin @yxieca could we merge this PR? We have new tests for the new chassis APIs and have converted existing API tests to work for chassis. We can push that once this is merged, as there's a dependency. Thanks.

@yxieca yxieca merged commit c8e2023 into sonic-net:master Feb 11, 2021
Chassis automation moved this from Reviewer approved to Done Feb 11, 2021
@rawal01 rawal01 deleted the pmon_tests branch March 19, 2021 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

7 participants