sonic-mgmt
sonic-mgmt copied to clipboard
[iface_namingmode]Update the iface naming mode test to get real speed of the ports
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
/azpw run
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).
@yxieca please help to review or assign someone to review
/azp run Azure.sonic-mgmt
Azure Pipelines successfully started running 1 pipeline(s).
/azpw run
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).
/azpw run
/AzurePipelines run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run Azure.sonic-mgmt
Azure Pipelines successfully started running 1 pipeline(s).
/azpw run Azure.sonic-mgmt
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:
- 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 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:
- 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 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:
- 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).