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

[202012][cherry-pick]Fix validation of input of config mirror_session add #2187

Conversation

bingwang-ms
Copy link
Contributor

Signed-off-by: bingwang [email protected]

What I did

This PR is to cherry-pick #2162 to 202012 branch after resolving conflict in test code.

FIX sonic-net/sonic-buildimage#10795

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)

Signed-off-by: bingwang <[email protected]>
@dprital
Copy link
Collaborator

dprital commented May 27, 2022

@arfeigin , please review

@bingwang-ms bingwang-ms merged commit b3928ed into sonic-net:202012 May 30, 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.

3 participants