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

[mock_tests] Add Sflow Orch UTs #2295

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

ayurkiv-nvda
Copy link
Contributor

Signed-off-by: Andriy Yurkiv [email protected]

What I did
Added Sflow gtest

Why I did it
Improve sflow orcagent coverage

How I verified it

ayurkiv@487e531606e9:/sonic/src/sonic-swss/tests/mock_tests$ ./tests --gtest_filter=SflowOrchTest*
Running main() from /build/googletest-YnT0O3/googletest-1.10.0.20201025/googletest/src/gtest_main.cc
Note: Google Test filter = SflowOrchTest*
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from SflowOrchTest
[ RUN      ] SflowOrchTest.SflowEnableDisable
[       OK ] SflowOrchTest.SflowEnableDisable (46 ms)
[ RUN      ] SflowOrchTest.SflowCreateDelete
[       OK ] SflowOrchTest.SflowCreateDelete (46 ms)
[----------] 2 tests from SflowOrchTest (92 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (93 ms total)
[  PASSED  ] 2 tests.

Details if related

@liat-grozovik
Copy link
Collaborator

@dgsudharsan could you please help to review ?

nazariig
nazariig previously approved these changes Jun 3, 2022
}

private:
void initSaiApi()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe many APIs here are duplicated and may be common across multiple tests https://github.com/Azure/sonic-swss/blob/40316f7189486f2541ca3e163f746946a62f55a1/tests/mock_tests/copporch_ut.cpp. Can we reorganize and reorganize the code to a common parent class and reuse?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you propose to create common parent class and use it for all tests in mock_tests directory?
It sounds like a really good idea, but it looks like a separate task that is not in scope of these changes.

}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a few cases for notifications coming from APP_SFLOW_SESSION_TABLE_NAME & APP_SFLOW_SAMPLE_RATE_TABLE_NAME tables?

Here is a reference on testing if sai api's are called as expected: https://github.com/Azure/sonic-swss/blob/master/tests/mock_tests/portsorch_ut.cpp#L92

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vivekreddynv primary goal of this PR is to add basic infrastructure for sflow orcagent test during Quality Week.
I have expected that tests will be added by someone else :)
Do you think we can invest more time and improve orcagent coverage?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the scope though
But i agree, the test can certainly be improved later on demand.

tests/mock_tests/sfloworh_ut.cpp Outdated Show resolved Hide resolved
@liat-grozovik
Copy link
Collaborator

@vadymhlushko-mlnx coulld you please review review comments?

@volodymyrsamotiy
Copy link
Collaborator

volodymyrsamotiy commented Jun 14, 2022

@vadymhlushko-mlnx coulld you please review review comments?

@ayurkiv-nvda will handle comments since it is his PR

@liat-grozovik
Copy link
Collaborator

@vivekreddynv can we move forward with the merge?

@vivekrnv
Copy link
Contributor

@vivekreddynv can we move forward with the merge?

yes, i'll approve the PR

@liat-grozovik liat-grozovik changed the title [mock_tests]: Add Sflow Orch UTs [mock_tests] Add Sflow Orch UTs Jun 24, 2022
@liat-grozovik liat-grozovik merged commit f88f992 into sonic-net:master Jun 24, 2022
jimmyzhai added a commit to sonic-net/sonic-buildimage that referenced this pull request Jun 27, 2022
2022-06-24 93af69c: [PFC_WD] Avoid applying ZeroBuffer Profiles to ingress PG when a PFC storm is detected (sonic-net/sonic-swss#2304)
2022-06-24 37349cf: [swssconfig] Optimize performance of swssconfig (sonic-net/sonic-swss#2336)
2022-06-24 84e9b07: [fdborch] fix heap-use-after-free in clearFdbEntry() (sonic-net/sonic-swss#2353)
2022-06-24 1b8bd94: Create ACL table fails due to incorrect check for supported ACL actions #11235 (sonic-net/sonic-swss#2351)
2022-06-24 1ed0b4b: [macsec] Refactor the logic of macsec name map (sonic-net/sonic-swss#2348)
2022-06-23 f88f992: [mock_tests] Add Sflow Orch UTs (sonic-net/sonic-swss#2295)
2022-06-23 ec57bf1: [macsec] Update macsec flex counter (sonic-net/sonic-swss#2338)
2022-06-22 6e0fc85: [ACL] Support stage particular match fields (sonic-net/sonic-swss#2341)
2022-06-22 efb4530: [orchagent, DTel]: report session support to set user vrf (sonic-net/sonic-swss#2326)
2022-06-22 d82874d: Fix for "orchagent crashed when trying to delete fdb static entry with swssconfig #11046" (sonic-net/sonic-swss#2332)
2022-06-22 0c789e6: Fix qos map test in vs test (sonic-net/sonic-swss#2343)
2022-06-17 1bb5070: Enhance mock test for dynamic buffer manager for port removing and qos reload flows (sonic-net/sonic-swss#2262)
2022-06-16 700492f: [aclorch] Fix and simplify DTel watchlist tables and entries (sonic-net/sonic-swss#2155)
preetham-singh pushed a commit to preetham-singh/sonic-swss that referenced this pull request Aug 6, 2022
- What I did
Added Sflow gtest

- Why I did it
Improve sflow orcagent coverage

- How I verified it
ayurkiv@487e531606e9:/sonic/src/sonic-swss/tests/mock_tests$ ./tests --gtest_filter=SflowOrchTest*
Running main() from /build/googletest-YnT0O3/googletest-1.10.0.20201025/googletest/src/gtest_main.cc
Note: Google Test filter = SflowOrchTest*
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from SflowOrchTest
[ RUN      ] SflowOrchTest.SflowEnableDisable
[       OK ] SflowOrchTest.SflowEnableDisable (46 ms)
[ RUN      ] SflowOrchTest.SflowCreateDelete
[       OK ] SflowOrchTest.SflowCreateDelete (46 ms)
[----------] 2 tests from SflowOrchTest (92 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (93 ms total)
[  PASSED  ] 2 tests.

Signed-off-by: Andriy Yurkiv <[email protected]>
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.

6 participants