Skip to content

Fix issues of test_platform_info#2187

Merged
wangxin merged 3 commits intosonic-net:masterfrom
wangxin:fix-platform-info-pr
Sep 22, 2020
Merged

Fix issues of test_platform_info#2187
wangxin merged 3 commits intosonic-net:masterfrom
wangxin:fix-platform-info-pr

Conversation

@wangxin
Copy link
Copy Markdown
Collaborator

@wangxin wangxin commented Sep 4, 2020

Description of PR

Summary:
Fixes # (issue)
Fix multiple issues of tests/platform_tests/test_platform_info.py.

Changes:

  1. Update ans_host to duthost.
  2. Import mellanox_thermal_control_test_helper to register mockers for Mellanox platform
  3. Update the methods checking platform fan and temperature to support both master and 201911

Type of change

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

Approach

What is the motivation for this PR?

There are couple of issues in test_platform_info.py and its dependent scripts.

  1. In test_platform_info.py, line 94 is still using deprecated ans_host. The issue was not exposed because it is in a branch that is rarely hit.
  2. In PR Unify the importing to avoid exception not caught issue #1864, a line for importing the mellanox_thermal_control_test_helper.py module was removed. This caused some mockers for Mellanox platform are not registered. Consequently some test cases in test_platform_info are always skipped.
  3. The code for checking platform fan and temperature is not able to handle the command output difference between master and 201911 branch.

How did you do it?

  1. Update ans_host to duthost.
  2. Import mellanox_thermal_control_test_helper to register mockers for Mellanox platform.
  3. Update the methods checking platform fan and temperature to support both master and 201911.

How did you verify/test it?

Test run the test_platform_info.py script on SONiC.20191130.44. Only one case test_thermal_control_fan_status failed because expected log is not found. This is another problem. All the other cases related with the changes are passed.

Any platform specific information?

Mellanox platform specific change.

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

Documentation

Changes:
1. Update `ans_host` to `duthost`.
2. Import mellanox_thermal_control_test_helper to register mockers for Mellanox platform
3. Update the methods checking platform fan and temperature to support both master and 201911

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
@wangxin wangxin requested a review from a team September 4, 2020 09:05
@wangxin
Copy link
Copy Markdown
Collaborator Author

wangxin commented Sep 4, 2020

@Junchao-Mellanox Could you please help review?

@Junchao-Mellanox
Copy link
Copy Markdown
Contributor

LGTM. Just one thought, the logic of RandomFanStatusMocker.check_result and RandomThermalStatusMocker.check_result looks similar, should we consider combining them into one?

@wangxin
Copy link
Copy Markdown
Collaborator Author

wangxin commented Sep 7, 2020

Thanks! Updated the PR. Used mixin to combine common code.

@wangxin
Copy link
Copy Markdown
Collaborator Author

wangxin commented Sep 9, 2020

retest this please

@yxieca
Copy link
Copy Markdown
Collaborator

yxieca commented Sep 14, 2020

retest vsimage please

@wangxin wangxin merged commit 3a20f96 into sonic-net:master Sep 22, 2020
@wangxin wangxin deleted the fix-platform-info-pr branch September 24, 2020 02:35
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
dd0fb84 (HEAD -> 202111, origin/202111) [mirrororch]: Implement HW resources availability validation for SPAN/ERSPAN (sonic-net#2187)
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.

3 participants