sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Update the fwutil function to support define the component for specific dut.

Open nhe-NV opened this issue 2 years ago • 6 comments

  1. In the existing fwutil test implement, user can only define the component(BIOS, ONIE, CPLD) based on the platform type, if for the same platform, it require to define different components for different dut(such as some setup are respined), them the origin implementation dose not support. modify the script to support such scenario.
  2. The fwutil test case should not be skipped, since the https://github.com/sonic-net/sonic-mgmt/issues/6489 is not a real issue.
  3. Fix some pep8 issue

Description of PR

Summary: Update the fwutil function to support define the component for specific dut. Fixes # (issue) Update the fwutil function to support define the component for specific dut.

Type of change

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

Back port request

  • [ ] 201911
  • [ ] 202012
  • [x] 202205

Approach

What is the motivation for this PR?

Update the fwutil function to support define the component for specific dut.

How did you do it?

How did you verify/test it?

Any platform specific information?

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

Documentation

nhe-NV avatar Nov 07 '22 07:11 nhe-NV

The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results: trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml
Fixing tests/platform_tests/fwutil/fwutil_common.py

fix end of files.........................................................Passed
check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml", line 4, column 1
found duplicate key "platform_tests/api/test_chassis.py::TestChassisApi::test_get_watchdog" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml", line 68, column 1

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

azure-pipelines[bot] avatar Nov 07 '22 07:11 azure-pipelines[bot]

The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results: trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml

fix end of files.........................................................Passed
check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml", line 4, column 1
found duplicate key "platform_tests/api/test_chassis.py::TestChassisApi::test_get_watchdog" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml", line 68, column 1

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

azure-pipelines[bot] avatar Nov 07 '22 10:11 azure-pipelines[bot]

/azpw run

nhe-NV avatar Nov 08 '22 01:11 nhe-NV

/AzurePipelines run

mssonicbld avatar Nov 08 '22 01:11 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 08 '22 01:11 azure-pipelines[bot]

The pre-commit check detected issues in the files touched by this pull request. The detected issues may be old or new. For new issues, please try to fix them.

For old issues, it is not mandatory to fix them because they were not caused by this change. It is unfair to blame author of this pull request. But if you can take extra effort to fix the old issues as well, that would be great!

Detailed pre-commit check results: trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml

fix end of files.........................................................Passed
check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

while constructing a mapping
in "tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml", line 4, column 1
found duplicate key "platform_tests/api/test_chassis.py::TestChassisApi::test_get_watchdog" with value "{}" (original value: "{}")
in "tests/common/plugins/conditional_mark/tests_mark_conditions_platform_tests.yaml", line 68, column 1

To suppress this check see:
http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys
...
[truncated extra lines, please run pre-commit locally to view full check results]

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>

azure-pipelines[bot] avatar Nov 08 '22 01:11 azure-pipelines[bot]

@yxieca could you help review/assign someone. It was tested on top of Nvidia platform and the test is now running properly. I believe we need this fix with prio and also in 202205.

liat-grozovik avatar Nov 14 '22 19:11 liat-grozovik

@prgeor, @sujinmkang please review this change. Thanks.

yxieca avatar Nov 15 '22 06:11 yxieca

@prgeor , @sujinmkang kindly reminder.

liat-grozovik avatar Nov 28 '22 16:11 liat-grozovik

@nhe-NV can you help backport this fix to 202012 and 202205? The conditional mark was backported to 202012 branch but all these tests are failed due to the issue closed.

  • @liat-grozovik and @prgeor

Blueve avatar Mar 03 '23 05:03 Blueve

@Blueve I added the backport requst for the 202205, but seems no actions for it, I will now add the backport request for the 202012.

nhe-NV avatar Mar 05 '23 09:03 nhe-NV

Thanks @nhe-NV ! I added backport labels and expect they can been cherry-picked in recent days. If they cannot be clean merged, I will let you know.

Blueve avatar Mar 09 '23 06:03 Blueve

@nhe-NV Cherry-picking this PR to 202012 branch got many conflicts. Can you create a separate PR to 202012 branch to include this change?

wangxin avatar Mar 10 '23 01:03 wangxin

@nhe-NV Cherry-picking this PR to 202012 branch got many conflicts. Can you create a separate PR to 202012 branch to include this change?

created the new PR for 202012

nhe-NV avatar Mar 13 '23 03:03 nhe-NV

@nhe-NV May I ask which platforms are supported for test_fwutil.py? Does is support Broadcom? The reason I asked this is because cases of test_fwutil.py failed on Broadcom platforms. Or, it only supports Mellanox?

ZhaohuiS avatar Mar 21 '23 05:03 ZhaohuiS

@nhe-NV I skipped this script for other platforms, only run it on mellanox, please review https://github.com/sonic-net/sonic-mgmt/pull/7802. Thanks.

ZhaohuiS avatar Mar 21 '23 06:03 ZhaohuiS

Hi,I only test on the mellanox platform, but I think on other platform it should work if they also support using fwtutil command to install or upgrade onie/cpld/bois.

Thanks

nhe-NV avatar Mar 21 '23 07:03 nhe-NV