Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202205] Fix validation of input of config mirror_session add #2494

Conversation

bingwang-ms
Copy link
Contributor

What I did

This PR is to backport PR #2162 into 202205 branch.

queue = 0 is not accepted by the validation of input because the follow check
https://github.com/Azure/sonic-utilities/blob/bce4694d3ad4454fc7181b99433457e76ab9e0a0/config/main.py#L2028-L2029

When addressing the issue, I saw similar issue in the logic of handling gre_type. The issue is also fixed.

How I did it

Change if queue to if queue is not None

How to verify it

Verified by UT

python setup.py test --addopts "tests/config_mirror_session_test.py -v" 
========================================================================================= test session starts =========================================================================================
collected 3 items                                                                                                                                                                                     

tests/config_mirror_session_test.py::test_mirror_session_add PASSED                                                                                                                             [ 33%]
tests/config_mirror_session_test.py::test_mirror_session_erspan_add PASSED                                                                                                                      [ 66%]
tests/config_mirror_session_test.py::test_mirror_session_span_add PASSED                                                                                                                        [100%]

========================================================================================== 3 passed in 0.96s ==========================================================================================

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@bingwang-ms bingwang-ms merged commit 166739e into sonic-net:202205 Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants