Documentation ¶
Overview ¶
Package subscribe contains test interface definitions for gnmi Subscribe RPC.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OneShotSetNodeArgs ¶
type OneShotSetNodeArgs struct { // YtypesArgs is the set of Args that are handed to the ytypes.SetNode function // directly. YtypesArgs []ytypes.SetNodeOpt // IgnoreInvalidPaths determines whether errors should be returned when // a particular value cannot be deserialised. This option is intended to be used // when a subscription returns invalid paths which are not of interest to the // test being run. It should be used with caution since it will result in masking // of error cases, with no warnings or errors returned. IgnoreInvalidPaths bool }
OneShotSetNodeArgs describes the options to be supplied to the OneShotSetNode function.
type Status ¶
type Status int
Status is a type that is used by test to notify test framework.
func OneShotGetOrCreate ¶
func OneShotGetOrCreate(schema *yang.Entry, root ygot.GoStruct, sr *gpb.SubscribeResponse) (Status, error)
OneShotGetOrCreate calls GetOrCreate for each Notification that is received with a value - deserialising the value into the supplied GoStruct using the specified schema. It returns Complete when the sync_response message is received. It is called in tests that require deserialisation of Notifications into a ygot struct without validation of the data value.
func OneShotSetNode ¶
func OneShotSetNode(schema *yang.Entry, root ygot.GoStruct, sr *gpb.SubscribeResponse, args OneShotSetNodeArgs) (Status, error)
OneShotSetNode unmarshals the values in gpb.SubscribeResponse into the given GoStruct with the provided schema. The sr SubscribeResponse is deserialised into the supplied root, using the supplied schema. The args struct controls the behaviour used for deserialisation.
type Subscribe ¶
type Subscribe interface { // Process is called for each individual message received. Status returned by // Process may have Running or Complete status. When Complete is returned, // test framework calls Check function of the test to get the holistic test // result and to unregister test. Process(sr *gpb.SubscribeResponse) (Status, error) // Check is called to get the holistic test result in the following cases; // - Process function returns Complete // - Test times out // - GNMI RPC request fails Check() error }
Subscribe is the interface of a test for gnmi Subscribe RPC.
type Test ¶
type Test struct {
// contains filtered or unexported fields
}
Test must be embedded by each gnmi Subscribe RPC test.
func (*Test) Check ¶
Check is the default implementation for a test that only evaluates individual messages via Process and does not return a stateful result across multiple messages.
func (*Test) GetRequest ¶
func (s *Test) GetRequest() *gpb.SubscribeRequest
GetRequest returns the gnmi SubscribeRequest stored in the receiver object.
func (*Test) SetRequest ¶
func (s *Test) SetRequest(sr *gpb.SubscribeRequest)
SetRequest stores the gnmi SubscribeRequest in the struct.