sonic-mgmt
sonic-mgmt copied to clipboard
test_auto_negotiation.py: Added test coverage for port speed change with reboot.
Added support for port speed config with reboot
Description of PR
Summary:
- Change the interface speed to 40G and do config reload
- Verify the speed should be configured and no crash.
Type of change
Added new testcase
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [x] Test case(new/improvement)
Back port request
- [ ] 201911
- [ ] 202012
- [ ] 202205
- [ ] 202305
Approach
What is the motivation for this PR?
The motivation for this PR is to verify device behaviour on reboot with 40G port speed.
How did you do it?
Automated new testcase "test_verify_portspeed_configuration_across_reboot" in script platform_tests/test_auto_negotiation.py
How did you verify/test it?
deployed T0 topology
./run_tests.sh -n vms-sn2700-t0 -d
Any platform specific information?
Supported testbed topology if it's a new test case?
any
Documentation
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: vesuresh537 / name: suresh.vemula (9d0112c276a305b012030e37815875329f81d43c, 857d509295857baa99876b828eac1faf06bf3523, 288f57e46357d50f389b67f5a6ec206390d21489, 2c74a810a3c9450acf8fc4385aba2cad885a6fa2, 7c847629e7f070f0a0d7238d1b65c0e39a2382eb, 46b8650c4e825d84f0c58525570979adad33291d, 4f4d9e6226cd7f03385b5a16bf49f5045008c6bf, 0fc4da7f4d41ecba8b20ac86e77a9c30c32e5546, 4010951fc24ba11ef9aa6decb946a3d163ea65b3, 4b2deb4b63faf8ff052dd0ca83b4126bbc984d27, 3182b43108038f499c9a580353495b8f4cf6d5d9, ace4f6fff5622b457be26037188cff0445bc501a, 89e1d3de6c0111dfce12d74363828ca81a5cb8d5, 8bf7b3e2dd6bcfefad0d9f3cd0091cfdf743d578)
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/platform_tests/test_auto_negotiation.py:373:1: E302 expected 2 blank lines, found 1
tests/platform_tests/test_auto_negotiation.py:380:12: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:380:33: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:380:41: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:380:51: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:381:27: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:383:12: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:383:33: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:383:41: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:383:51: E231 missing whitespace after ','
...
[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-commitpackage 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/platform_tests/test_auto_negotiation.py:373:1: E302 expected 2 blank lines, found 1
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-commitpackage 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/platform_tests/test_auto_negotiation.py:373:1: E302 expected 2 blank lines, found 1
tests/platform_tests/test_auto_negotiation.py:382:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:383:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:384:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:384:15: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:384:45: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:385:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:386:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:386:34: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:387:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:388:12: E111 indentation is not a multiple of 4
...
[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-commitpackage 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/platform_tests/test_auto_negotiation.py:373:1: E302 expected 2 blank lines, found 1
tests/platform_tests/test_auto_negotiation.py:382:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:383:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:384:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:384:15: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:384:45: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:385:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:386:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:386:34: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:387:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:388:12: E111 indentation is not a multiple of 4
...
[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-commitpackage 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/platform_tests/test_auto_negotiation.py:383:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:384:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:385:8: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:385:15: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:385:45: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:386:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:387:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:387:34: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:388:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:389:12: E111 indentation is not a multiple of 4
tests/platform_tests/test_auto_negotiation.py:398:12: E111 indentation is not a multiple of 4
...
[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-commitpackage 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/platform_tests/test_auto_negotiation.py:385:16: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:385:46: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:387:35: E231 missing whitespace after ','
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-commitpackage 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/platform_tests/test_auto_negotiation.py:385:16: E231 missing whitespace after ','
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-commitpackage 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.........................................................Failed
- hook id: check-ast
- exit code: 1
tests/platform_tests/test_auto_negotiation.py: failed parsing with CPython 3.8.10:
Traceback (most recent call last):
File "/home/AzDevOps/.cache/pre-commit/repo6v2gmzzp/py_env-python3/lib/python3.8/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
File "/usr/lib/python3.8/ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "tests/platform_tests/test_auto_negotiation.py", line 385
for dut,port in zip([duthost, fanout],[dut_port, fanout_port]):
^
IndentationError: unindent does not match any outer indentation level
...
[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-commitpackage 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.........................................................Failed
- hook id: check-ast
- exit code: 1
tests/platform_tests/test_auto_negotiation.py: failed parsing with CPython 3.8.10:
Traceback (most recent call last):
File "/home/AzDevOps/.cache/pre-commit/reporvpnnb2w/py_env-python3/lib/python3.8/site-packages/pre_commit_hooks/check_ast.py", line 21, in main
ast.parse(f.read(), filename=filename)
File "/usr/lib/python3.8/ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "tests/platform_tests/test_auto_negotiation.py", line 385
for dut,port in zip([duthost, fanout],[dut_port, fanout_port]):
^
IndentationError: unindent does not match any outer indentation level
...
[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-commitpackage 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/platform_tests/test_auto_negotiation.py:385:16: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:385:46: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:387:35: E231 missing whitespace after ','
tests/platform_tests/test_auto_negotiation.py:406:61: E231 missing whitespace after ','
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-commitpackage 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 @prgeor - It's been waiting long time, btw Prince George is code owner for this repo. Can you guys approve this PR or assign to right owner. Thanks
@yxieca @prgeor - It's been waiting long time, btw Prince George is code owner for this repo. Can you guys approve this PR or assign to right owner. Thanks
please work with @bpar9 to solve the blocking issue. There is a test failure. Please check if the failure was caused by this change. Thanks.
/azp run
Commenter does not have sufficient privileges for PR 11226 in repo sonic-net/sonic-mgmt
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
@prgeor @yxieca can you approve and merge this PR. thx