Skip to content

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

Merged
liat-grozovik merged 1 commit intosonic-net:masterfrom
nhe-NV:update_fwutil
Dec 1, 2022
Merged

Update the fwutil function to support define the component for specific dut.#6756
liat-grozovik merged 1 commit intosonic-net:masterfrom
nhe-NV:update_fwutil

Conversation

@nhe-NV
Copy link
Copy Markdown
Contributor

@nhe-NV nhe-NV commented Nov 7, 2022

  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 [test_fwutil]fixture 'fw_pkg_name' not found #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

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

Back port request

  • 201911
  • 202012
  • 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 nhe-NV requested a review from sujinmkang as a code owner November 7, 2022 07:00
@azure-pipelines
Copy link
Copy Markdown

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>

Copy link
Copy Markdown
Contributor

@roy-sror roy-sror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Nana,

I've published some comments, please have a look.

Roy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the component content, in case there is a pre-definition for a specific host.
Sometimes, if there is some DUTs has specific component(for example a respined board which requires a different CPLD) - it can be defined in the firmware.json file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest also to change the firmware.json to include such an instance, as an example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how can you guarantee that defined_fw["host"] exists?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to deep copy the sub-dictionary? can't we do it in a more pythonic way?

…ic setup

Change-Id: I416d470b62f4b100fd23ad8468ada5b461470e5e
@azure-pipelines
Copy link
Copy Markdown

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>

@nhe-NV
Copy link
Copy Markdown
Contributor Author

nhe-NV commented Nov 8, 2022

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link
Copy Markdown

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>

@liat-grozovik
Copy link
Copy Markdown
Collaborator

@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.

@yxieca
Copy link
Copy Markdown
Collaborator

yxieca commented Nov 15, 2022

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

@liat-grozovik
Copy link
Copy Markdown
Collaborator

@prgeor , @sujinmkang kindly reminder.

@liat-grozovik liat-grozovik merged commit aacdf8e into sonic-net:master Dec 1, 2022
@Blueve
Copy link
Copy Markdown
Collaborator

Blueve commented Mar 3, 2023

@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.

@nhe-NV
Copy link
Copy Markdown
Contributor Author

nhe-NV commented Mar 5, 2023

@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.

@Blueve
Copy link
Copy Markdown
Collaborator

Blueve commented Mar 9, 2023

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.

wangxin pushed a commit that referenced this pull request Mar 10, 2023
…ic setup (#6756)

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 [test_fwutil]fixture 'fw_pkg_name' not found #6489 is not a real issue.
Fix some pep8 issue
@wangxin
Copy link
Copy Markdown
Collaborator

wangxin commented Mar 10, 2023

@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 added a commit to nhe-NV/sonic-mgmt that referenced this pull request Mar 13, 2023
…ic setup (sonic-net#6756)

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 [test_fwutil]fixture 'fw_pkg_name' not found sonic-net#6489 is not a real issue.
Fix some pep8 issue
@nhe-NV
Copy link
Copy Markdown
Contributor Author

nhe-NV commented Mar 13, 2023

@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

Blueve pushed a commit that referenced this pull request Mar 14, 2023
…ic dut.(202012) (#6756) (#7726)

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 [test_fwutil]fixture 'fw_pkg_name' not found #6489 is not a real issue.
Fix some pep8 issue
@ZhaohuiS
Copy link
Copy Markdown
Contributor

ZhaohuiS commented Mar 21, 2023

@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
Copy link
Copy Markdown
Contributor

@nhe-NV I skipped this script for other platforms, only run it on mellanox, please review #7802. Thanks.

@nhe-NV
Copy link
Copy Markdown
Contributor Author

nhe-NV commented Mar 21, 2023

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

ZhaohuiS pushed a commit to ZhaohuiS/sonic-mgmt that referenced this pull request Aug 18, 2023
Skip fwutil tests in Celestica-e1031 nightly pipeline until below PR backport to internal-202012:

* sonic-net#6756
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.

8 participants