[pytest]: various tests re-written in pytest#802
Merged
lguohan merged 6 commits intosonic-net:masterfrom Apr 7, 2019
Merged
Conversation
requires pytest-ansible module Signed-off-by: Guohan Lu <[email protected]>
stcheng
approved these changes
Feb 6, 2019
Signed-off-by: Guohan Lu <[email protected]>
Signed-off-by: Guohan Lu <[email protected]>
qiluo-msft
reviewed
Apr 3, 2019
Signed-off-by: Guohan Lu <[email protected]>
Contributor
Author
|
next task is to add inventory management |
Signed-off-by: Guohan Lu <[email protected]>
1 task
1 task
auspham
pushed a commit
to auspham/sonic-mgmt
that referenced
this pull request
Feb 3, 2026
Initialize lldpctl_interface in ansible/tests/lldp/test_lldpsyncd.py in order to prevent potential UnboundLocalError. <!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR <!-- - Please include a summary of the change and which issue is fixed. - Please also include relevant motivation and context. Where should reviewer start? background context? - List any dependencies that are required for this change. --> Summary: Fixes # (issue) Fix potential UnboundLocalError in ansible/tests/lldp/test_lldp_syncd.py by initializing lldpctl_interface to None. The assertion this variable is passed to performs an existence check, and so will fail the testlet appropriately if lldpctl_interface is not set. ### Type of change - [x] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [x] 202505 ### Approach #### What is the motivation for this PR? Enhance the debug-ability of ansible/tests/lldp/test_lldpsyncd.py such that in the even that no lldp interface is identified in the test, the error is propagated up to and reported by the verification method and does not simply throw UnboundLocalError. #### How did you do it? Fix is to initialize the variable lldpctl_interface to None outside of conditional logic so that it has a value when passed to the test verification method. #### How did you verify/test it? Verified that the same failing test case no longer throws UnboundLocalError and fails in a meaningful way for further debug.
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
…on (sonic-net#3443) Submodule src/sonic-platform-common ac7fde6..58f9672: > [sfp_base] Raise exceptions (previously was incorrectly returning them) (sonic-net#61) Submodule src/sonic-swss 660530e..2974844: > Fix MIRROR_SESSION table macro name (sonic-net#802) > Don't try to remove a vxlan tunnel if it has associated tunnel maps (sonic-net#1052) Submodule src/sonic-swss-common d6140fa..d7b1f53: > Fix MIRROR_SESSION table macro name (sonic-net#264) Signed-off-by: Ying Xie <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
requires pytest-ansible module
Signed-off-by: Guohan Lu [email protected]
Description of PR
Summary:
Fixes # (issue)
Type of change
Approach
How did you do it?
this is equivalent of bgp_facts.yml test but much simpler.
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation