[ovsp4rt] Implement Client class (DRAFT) #727
Closed
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.
Superseded by PR #732
This is a project to improve the testability of ovsp4rt. See issue #701 for details.
Modified ovsp4rt.cc to use a
Client
object instead of anOvsP4rtSession
object to communicate with the P4Runtime server.Made each public C API function a wrapper around a C++ function that accepts a
Client
object as a parameter. This allows a test to replace the object with a test double (e.g. a mock).Moved the C API functions to another file (
ovsp4rt_standard_api.cc
orovsp4rt_journal_api.cc
), separating the user interface from the implementation.Note
BUILD_CLIENT
cmake option is enabled by default in this branch. CI can't compile the modified version ofovsp4rt.cc
without it.BUILD_JOURNAL
cmake option is also enabled by default, so the CI workflow compiles that as well.This PR supersedes PR #674.