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

[iface_namingmode]Update the iface naming mode test to get real speed of the ports

Open nhe-NV opened this issue 1 year ago • 14 comments

In the fixture, the test will save all the speed of the up port, in the original implement, it could not get the real speed of the port,update it to use the speed in the running config.

Description of PR

Summary: Fixes # (issue) https://github.com/sonic-net/sonic-mgmt/issues/11358

Type of change

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

Back port request

  • [ ] 201911
  • [ ] 202012
  • [x] 202205
  • [x] 202305
  • [x] 202311

Approach

What is the motivation for this PR?

In the cleanup of the TestConfigInterface, the fixture will reset the port speed to the orignal speed, but in the original fixture implement, the speed of the port is not correct, if the speed is not supported on this port, then the port will be changed to down status.

How did you do it?

Get the correct speed for each up port in the fixture of the test

How did you verify/test it?

run all the iface_namingmode test, all could pass.

Any platform specific information?

No

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

Documentation

nhe-NV avatar Jan 23 '24 04:01 nhe-NV

/azpw run

nhe-NV avatar Feb 07 '24 10:02 nhe-NV

/AzurePipelines run

mssonicbld avatar Feb 07 '24 10:02 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 07 '24 10:02 azure-pipelines[bot]

@yxieca please help to review or assign someone to review

liat-grozovik avatar Feb 12 '24 14:02 liat-grozovik

/azp run Azure.sonic-mgmt

liat-grozovik avatar Feb 12 '24 14:02 liat-grozovik

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 12 '24 14:02 azure-pipelines[bot]

/azpw run

nhe-NV avatar Feb 17 '24 02:02 nhe-NV

/AzurePipelines run

mssonicbld avatar Feb 17 '24 02:02 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 17 '24 02:02 azure-pipelines[bot]

/azpw run

nhe-NV avatar Feb 19 '24 02:02 nhe-NV

/AzurePipelines run

mssonicbld avatar Feb 19 '24 02:02 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Feb 19 '24 02:02 azure-pipelines[bot]

/azp run Azure.sonic-mgmt

liat-grozovik avatar Apr 16 '24 13:04 liat-grozovik

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Apr 16 '24 13:04 azure-pipelines[bot]

/azpw run Azure.sonic-mgmt

liat-grozovik avatar May 07 '24 11:05 liat-grozovik

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/iface_namingmode/test_iface_namingmode.py:318:15: E275 missing whitespace after keyword
tests/iface_namingmode/test_iface_namingmode.py:552:15: E275 missing whitespace after keyword

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(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>

mssonicbld avatar May 10 '24 04:05 mssonicbld

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/iface_namingmode/test_iface_namingmode.py:318:15: E275 missing whitespace after keyword
tests/iface_namingmode/test_iface_namingmode.py:552:15: E275 missing whitespace after keyword

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(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>

mssonicbld avatar May 10 '24 04:05 mssonicbld

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/iface_namingmode/test_iface_namingmode.py:321:15: E275 missing whitespace after keyword
tests/iface_namingmode/test_iface_namingmode.py:555:15: E275 missing whitespace after keyword

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(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>

mssonicbld avatar May 10 '24 04:05 mssonicbld

/azpw run

nhe-NV avatar May 10 '24 05:05 nhe-NV

/AzurePipelines run

mssonicbld avatar May 10 '24 05:05 mssonicbld

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar May 10 '24 05:05 azure-pipelines[bot]