sonic-mgmt
sonic-mgmt copied to clipboard
Use lldp0/lldp1 instead of lldp, since container lldp was removed from the host
Description of PR
test_lldp_neighbor testcase fails since container lldp was removed form the host
admin@ixre-board7:~$ docker exec -i lldp lldpcli show chassis Error response from daemon: No such container: lldp
for this reason, we will test either lldp0 or lldp1 based on randomly selected Asic.
Summary: Fixes # (issue)
Type of change
- [ ] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [x] Test case(new/improvement)
Back port request
- [ ] 201911
- [ ] 202012
- [ ] 202205
- [ ] 202305
- [ ] 202311
Approach
What is the motivation for this PR?
since container lldp was removed from the host, we will test on lldp0 or lldp1 to test the test_lldp_neighbor testcase.
How did you do it?
Use enum_rand_one_frontend_asic_index to randomly select an Asic index Use the Asic index to select either lldp0 or lldp1
How did you verify/test it?
Tested on a multi cards multi Asics chassis.
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
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/lldp/test_lldp.py:59:121: E501 line too long (122 > 120 characters)
tests/lldp/test_lldp.py:65:81: E127 continuation line over-indented for visual indent
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 is mandatory. Please help have a look.
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/lldp/test_lldp.py:66:81: E127 continuation line over-indented for visual indent
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>
please retest with latest sonic-mgmt as fix is merged
https://github.com/sonic-net/sonic-mgmt/pull/13190
This change is still needed. @abdosi can you sign-off on this PR
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
lldp test failed in the PR test, please check
@mannytaheri please resolve conflicts
@mannytaheri, please resolve conflicts
@mannytaheri - reminder to please resolve conflicts, thanks.
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/lldp/test_lldp.py:75:5: F841 local variable 'internal_port_list' is assigned to but never used
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>
@mannytaheri PR conflicts with 202405 branch
@mannytaheri Could you please add a new PR for 202405 branch as this one had conflicts. Thanks
Create https://github.com/sonic-net/sonic-mgmt/pull/15385 for cherry-picking.
Please be note that, in current PR, supposedly Manny wanted to reduce test enumerations by using enum_rand_one_frontend_asic_index instead of enum_frontend_asic_index.
But it shouldn't work because it's on check_lldp_neighbor rather than test_lldp_neighbor.
In my cherry-pick PR I ignored the change because it's not harmful to enumerate other asics