Skip to content

Enhancement of test_sensors.py to address several issues#14154

Merged
bingwang-ms merged 1 commit intosonic-net:masterfrom
mhen1:dynamic_psu_enhancement
Sep 10, 2024
Merged

Enhancement of test_sensors.py to address several issues#14154
bingwang-ms merged 1 commit intosonic-net:masterfrom
mhen1:dynamic_psu_enhancement

Conversation

@mhen1
Copy link
Copy Markdown
Contributor

@mhen1 mhen1 commented Aug 18, 2024

Description of PR

Summary:
Fixes # (issue)
Enhancement of test_sensors.py to address several issues:

  1. Updated PSU mapping of msn4600-r0 platform.
  2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
  3. Added support to PSU Model MTEF-AC-G.

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?

Address several issues with the sensor test case.

How did you do it?

Updated the Dynamic PSU mapping process to address the issues.

How did you verify/test it?

Run test_sensors.py on several Systems (each of the PSU Models listed in psu_data.yaml).

Any platform specific information?

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

Documentation

@mhen1 mhen1 requested a review from prgeor as a code owner August 18, 2024 10:53
@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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/platform_tests/sensors_utils/psu_sensor_utils.py

check yaml...............................................................Passed
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/platform_tests/test_sensors.py:56:121: E501 line too long (138 > 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>

@mhen1 mhen1 force-pushed the dynamic_psu_enhancement branch from aa94e06 to 08a4ebd Compare August 18, 2024 10:59
@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.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing tests/platform_tests/sensors_utils/psu_sensor_utils.py

check yaml...............................................................Passed
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/platform_tests/test_sensors.py:56:121: E501 line too long (138 > 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>

Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
@mhen1 mhen1 force-pushed the dynamic_psu_enhancement branch from 08a4ebd to dbd2e51 Compare August 18, 2024 11:47
@wsycqyz
Copy link
Copy Markdown
Contributor

wsycqyz commented Aug 20, 2024

Do we need this PR in 202311 or 202405 branch?

@mhen1
Copy link
Copy Markdown
Contributor Author

mhen1 commented Aug 20, 2024 via email

@bingwang-ms
Copy link
Copy Markdown
Collaborator

I confirmed this PR will fix the test_sensor failure on SN4600. But the failure on SN2700A1 is not fixed. Need some update.

@mhen1
Copy link
Copy Markdown
Contributor Author

mhen1 commented Aug 27, 2024

I confirmed this PR will fix the test_sensor failure on SN4600. But the failure on SN2700A1 is not fixed. Need some update.

Hey, I believe the following PR to sonic-buildimage should resolve the issue - sonic-net/sonic-buildimage#19515
Please verify it does and if so, This PR is ready from my part (and needs to be backported to 202311/202405 as well).

@bingwang-ms
Copy link
Copy Markdown
Collaborator

LGTM.

@bingwang-ms bingwang-ms merged commit bde68a2 into sonic-net:master Sep 10, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 10, 2024
…4154)

Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202405: #14488

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 10, 2024
…4154)

Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202311: #14489

mssonicbld pushed a commit that referenced this pull request Sep 10, 2024
Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
mssonicbld pushed a commit that referenced this pull request Sep 12, 2024
Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Sep 20, 2024
…4154)

Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
…4154)

Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
…4154)

Details:
1. Updated PSU mapping of msn4600-r0 platform.
2. Updated test to support both Forward (PSF) and Reversed (PSR) versions of each PSU Model.
3. Added support to PSU Model MTEF-AC-G.
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.

4 participants