Skip to content

Commit

Permalink
[Mellanox] Refactor Mellanox platform API to support dynamic port con…
Browse files Browse the repository at this point in the history
…figuration (#8422)

- Why I did it
* To support systems with dynamic port configuration
* Apply lazy initialization to faster the speed of loading platform API

- How I did it
* Add module.py to implement dynamic port configuration (aka line card model)
* Adjust chassis.py, platform.py, thermal.py, sfp.py to support dynamic port configuration
* Optimize existing code

- How to verify it
Platform regression on MSN4700, MSN3800 and MSN2700, 100% pass
Unit test covers all new changes.
  • Loading branch information
Junchao-Mellanox authored Oct 25, 2021
1 parent d051bc4 commit e8b4c2a
Show file tree
Hide file tree
Showing 32 changed files with 3,661 additions and 2,036 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ dockers/**/buildinfo
platform/**/buildinfo
sonic-slave*/**/buildinfo

# pytest coverage files
.coverage
coverage.xml
test-results.xml
htmlcov/

# Dev tools
.vscode/
.idea/

4 changes: 4 additions & 0 deletions platform/mellanox/mlnx-platform-api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
*.pyc
.cache/
*/test-results.xml
*/htmlcov/
*/coverage.xml
*/.coverage
1 change: 1 addition & 0 deletions platform/mellanox/mlnx-platform-api/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
## limitations under the License.
##
[pytest]
addopts = --cov=sonic_platform --cov-report html --cov-report term --cov-report xml --junitxml=test-results.xml -vv
filterwarnings =
ignore::DeprecationWarning
Loading

0 comments on commit e8b4c2a

Please sign in to comment.