DPU test cases with GNMI and Protobuf#9238
Merged
Pterosaur merged 18 commits intosonic-net:masterfrom Sep 27, 2023
Merged
Conversation
d32e19d to
f855186
Compare
Signed-off-by: Ze Gan <ganze718@gmail.com>
f855186 to
6d4abba
Compare
qiluo-msft
reviewed
Aug 7, 2023
qiluo-msft
reviewed
Aug 7, 2023
qiluo-msft
reviewed
Aug 7, 2023
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Ze Gan <ganze718@gmail.com>
a46ede3 to
20bece8
Compare
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
Author
|
/azpw run |
Collaborator
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
tests/dash/gnmi_utils.py
Outdated
| def json_to_proto(key, json_obj): | ||
| table_name = re.search(r"DASH_(\w+)_TABLE", key).group(1) | ||
| if table_name == "APPLIANCE": | ||
| pb = Appliance() |
Contributor
There was a problem hiding this comment.
I suggest splitting the implementation of json_to_proto and making it more generic, so it will be easier to add support for the new objects in the future:
def appliance_from_json(json_obj):
pb = Appliance()
pb.sip.ipv4 = socket.htonl(int(ipaddress.IPv4Address(json_obj["sip"])))
pb.vm_vni = int(json_obj["vm_vni"])
return pb
def vnet_from_json(json_obj):
pb = Vnet()
pb.vni = int(json_obj["vni"])
pb.guid.value = bytes.fromhex(uuid.UUID(json_obj["guid"]).hex)
return pb
handlers_map = {
"DASH_APPLIANCE": appliance_from_json,
"DASH_VNET": vnet_from_json
}
def json_to_proto(key, json_obj):
table, row = key.split(TABLE_NAME_SEPARATOR, 1)
if table not in handlers_map:
raise RuntimeError(f"Unknown DASH table: {table}")
return handlers_map[table](json_obj)
oleksandrivantsiv
requested changes
Sep 26, 2023
| logger.info("Invalid operation %s" % operation["OP"]) | ||
| ret, msg = gnmi_set(duthost, ptfhost, delete_list, update_list, []) | ||
| assert ret == 0, msg | ||
| time.sleep(5) |
Contributor
There was a problem hiding this comment.
Why do we need to sleep here?
Contributor
There was a problem hiding this comment.
GNMI will update APPL_DB, and orchagent can't invoke SAI immediately.
We have to wait a few seconds to verify dataplane.
Contributor
Author
There was a problem hiding this comment.
In the future, we will have a feedback loop so that we don't need to sleep but need to wait for a dedicated event
Signed-off-by: Ze Gan <ganze718@gmail.com>
Signed-off-by: Ze Gan <ganze718@gmail.com>
f1d4a03 to
e5ed46d
Compare
ganglyu
previously approved these changes
Sep 27, 2023
This reverts commit f1d4a03.
ganglyu
approved these changes
Sep 27, 2023
AharonMalkin
pushed a commit
to AharonMalkin/sonic-mgmt
that referenced
this pull request
Jan 25, 2024
What is the motivation for this PR? Add new topology DPU to Azp Port exiting DASH test cases to support GNMI and protobuf changes How did you do it? Enable a new job for DPU Replace the original interface ,swssconfig, to 'gnmi client' Convert json format to protobuf How did you verify/test it? Check Azp --------- Signed-off-by: Ze Gan <ganze718@gmail.com> Co-authored-by: ganglyu <ganglv@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation