Skip to content

Skip test_fwutil on other platforms except Mellanox#7802

Merged
ZhaohuiS merged 2 commits intosonic-net:masterfrom
ZhaohuiS:fix/skip_test_fwutil_except_mellanox
Mar 22, 2023
Merged

Skip test_fwutil on other platforms except Mellanox#7802
ZhaohuiS merged 2 commits intosonic-net:masterfrom
ZhaohuiS:fix/skip_test_fwutil_except_mellanox

Conversation

@ZhaohuiS
Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Fixes # (issue)

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?

Test case failed on Broadcom platforms with the following error:

platform_tests/fwutil/test_fwutil.py::test_fwutil_show 
-------------------------------- live log call ---------------------------------
17:00:35 __init__.pytest_runtest_call             L0040 ERROR  | Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/_pytest/python.py", line 1464, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/usr/local/lib/python2.7/dist-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 208, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 81, in get_result
    _reraise(*ex)  # noqa
  File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python2.7/dist-packages/_pytest/python.py", line 174, in pytest_pyfunc_call
    testfunction(**testargs)
  File "/azp/_work/24/s/sonic-mgmt-int/tests/platform_tests/fwutil/test_fwutil.py", line 18, in test_fwutil_show
    flat=True)
  File "/azp/_work/24/s/sonic-mgmt-int/tests/common/devices/base.py", line 89, in _run
    raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res)
RunAnsibleModuleFail: run module fetch failed, Ansible Results =>
{"changed": false, "failed": true, "msg": "file not found: /usr/share/sonic/device/x86_64-arista_7050_qx32s/platform_components.json"}

How did you do it?

Skip test_fwutil for other platforms.

How did you verify/test it?

Run test_fwutil.py on Broadcom platform devices.

Any platform specific information?

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

Documentation

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator

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...............................................................Passed
check for added large files..............................................Passed
check python ast.....................................(no files to check)Skipped
flake8...............................................(no files to check)Skipped

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
nhe-NV previously approved these changes Mar 21, 2023
skip:
reason: "Doesn't support other platforms except Mellanox"
conditions:
- "asic_type not in ['mellanox']"
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.

we should ask other platform to support fwutil

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.

@prgeor Raised #7811 to track it and will add this issue in condition.

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
@ZhaohuiS ZhaohuiS merged commit e8aab84 into sonic-net:master Mar 22, 2023
wangxin pushed a commit that referenced this pull request Mar 24, 2023
How did you do it?
Skip test_fwutil for other platforms.

How did you verify/test it?
Run test_fwutil.py on Broadcom platform devices.

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
wangxin pushed a commit that referenced this pull request Mar 24, 2023
How did you do it?
Skip test_fwutil for other platforms.

How did you verify/test it?
Run test_fwutil.py on Broadcom platform devices.

Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
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.

6 participants