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

[acl] Add regression test for config acl CLI command #1694

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

daall
Copy link
Contributor

@daall daall commented Apr 6, 2021

Add a new test case to catch the bug where calling "config acl add table" multiple
times causes the "ports" field to be deleted from config DB.

Signed-off-by: Danny Allen daall@microsoft.com

What I did/why I did it
I added a test case to guard against regressions like the one described in sonic-net/sonic-utilities#1519.

How I verified it
Ran the test case w/ and w/o the change from 1519.

Add a new test case to catch the bug where calling "config acl add table" multiple
times causes the "ports" field to be deleted from config DB.

Signed-off-by: Danny Allen <daall@microsoft.com>
@lguohan
Copy link
Contributor

lguohan commented Apr 6, 2021

since 1519 is not merge, isn't this new test supposed to be fail?

@daall
Copy link
Contributor Author

daall commented Apr 7, 2021

since 1519 is not merge, isn't this new test supposed to be fail?

I am trying to figure out if the underlying issue has been resolved in the master branch or if there is some weird discrepancy between the physical device and the virtual switch. Will update shortly.

@daall
Copy link
Contributor Author

daall commented Apr 12, 2021

since 1519 is not merge, isn't this new test supposed to be fail?

I am trying to figure out if the underlying issue has been resolved in the master branch or if there is some weird discrepancy between the physical device and the virtual switch. Will update shortly.

The underlying issue seems to have been fixed in the master branch, so let me track down the change and see if this is a bugfix we can also grab for 201911.

@daall
Copy link
Contributor Author

daall commented Apr 14, 2021

since 1519 is not merge, isn't this new test supposed to be fail?

I am trying to figure out if the underlying issue has been resolved in the master branch or if there is some weird discrepancy between the physical device and the virtual switch. Will update shortly.

The underlying issue seems to have been fixed in the master branch, so let me track down the change and see if this is a bugfix we can also grab for 201911.

This is the reason for the difference: sonic-net/sonic-utilities#1392 It seems like the bug exists in swsssdk but not swss-common. I think we should still merge this test case just to prevent any similar regressions in the future. @lguohan do you agree?

@qiluo-msft
Copy link
Contributor

qiluo-msft commented Apr 15, 2021

This is interesting. How confident are you that sonic-net/sonic-utilities#1392 fixed the bug? It is expected as refactoring. If you know the detail, could you explain your API call sequence into swss-common or swsssdk? I can help check the sequence to make sure it is fixed.

@daall
Copy link
Contributor Author

daall commented Apr 15, 2021

This is interesting. How confident are you that Azure/sonic-utilities#1392 fixed the bug? It is expected as refactoring. If you know the detail, could you explain your API call sequence into swss-common or swsssdk? I can help check the sequence to make sure it is fixed.

They're both calling set_entry from ConfigDBConnector. When ConfigDBConnector is imported from swsscommon, everything works as expected and we can call set_entry with ports@ without issue. When ConfigDBConnector is imported from swsssdk, then the first call to set_entry works as expected, but the second call deletes the ports@ field from config DB.


In reply to: 820805641

@lguohan
Copy link
Contributor

lguohan commented Apr 16, 2021

test looks good to me, please proceed to merge.

@daall daall merged commit 1b916c3 into sonic-net:master Apr 19, 2021
@daall daall deleted the acl_regression_test branch April 19, 2021 17:57
@qiluo-msft
Copy link
Contributor

I analyze this flow, and everything you observed is expected. In old swsssdk, set_entry expected array field in data must have no trailing @, and array value must be an array. If you gave the other way, it unfortunately remove the field at 2nd call.
However, swsscommon could handle both styles, so it's more tolerable.


In reply to: 820805641

raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-swss that referenced this pull request Oct 5, 2021
Add a new test case to catch the bug where calling "config acl add table" multiple
times causes the "ports" field to be deleted from config DB.

Signed-off-by: Danny Allen <daall@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants