-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix Wildcard entries to return empty data instead of invalid path #299
Fix Wildcard entries to return empty data instead of invalid path #299
Conversation
…-gnmi into fix_wildcard_invalid_bug
@@ -3487,6 +3487,77 @@ func TestClientConnections(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestNonExistentTableNoError(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test
|
||
if diff := pretty.Compare(tt.wantNoti, gotNoti); diff != "" { | ||
t.Log("\n Want: \n", tt.wantNoti) | ||
t.Log("\n Got: \n", gotNoti) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to verify if the gnmi response is correct.
Seems like a bug in your manual test: "{}" #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test to verify gnmi response is empty json, please take a look at EMPTY_JSON.txt.
It is not a bug, as gnmi_client as part of subscribe will print out json_ietf_value as json string and "{}" is a valid response.
json_ietf structured value should be a valid json string, which empty json represented as string, "{}", is.
https://github.com/openconfig/reference/blob/master/rpc/gnmi/gnmi-specification.md#23-structured-data-types
If we use gnmi_get which prints out json and not json string, we indeed get expected empty json
[elem {
name: "PSU_INFO"
}
]
The GetResponse is below
{}
58a5342
@qiluo-msft , @zbud-msft has made the changes per your review comment. if the new changes looks good and no other comments, can you you help approve/merge this PR? |
@BYGX-wcr , please help monitor this PR state. When it is merged, please work with @zbud-msft to port this needed fix to internal 202205 chassis branch via patch. Thanks! |
Why I did it
How I did it
How to verify it
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)