sonic-mgmt
sonic-mgmt copied to clipboard
Update the fwutil function to support define the component for specific dut.
- 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.
- The fwutil test case should not be skipped, since the https://github.com/sonic-net/sonic-mgmt/issues/6489 is not a real issue.
- 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
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:
- 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.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
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:
- 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.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
/azpw run
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).
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:
- 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.
- Ensure that the
pre-commit
package is installed:
sudo pip install pre-commit
- Go to repository root folder
- Install the pre-commit hooks:
pre-commit install
- Use pre-commit to check staged file:
pre-commit
- Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>
@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.
@prgeor, @sujinmkang please review this change. Thanks.
@prgeor , @sujinmkang kindly reminder.
@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 I added the backport requst for the 202205, but seems no actions for it, I will now add the backport request for the 202012.
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.
@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?
@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 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?
@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.
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