Documentation
¶
Index ¶
- Constants
- func AddTargetToTopo(ctx context.Context, targetEntity *topo.Object) error
- func CreateSimulator(ctx context.Context, t *testing.T) *helm.HelmRelease
- func CreateSimulatorWithName(ctx context.Context, t *testing.T, name string, createTopoEntity bool) *helm.HelmRelease
- func DeleteSimulator(t *testing.T, simulator *helm.HelmRelease)
- func GetOnosConfigDestination() (gnmiclient.Destination, error)
- func GetTargetPath(target string, path string) []protoutils.TargetPath
- func GetTargetPathWithValue(target string, path string, value string, valueType string) []protoutils.TargetPath
- func GetTargetPaths(targets []string, paths []string) []protoutils.TargetPath
- func GetTargetPathsWithValues(targets []string, paths []string, values []string) []protoutils.TargetPath
- func MakeContext() (context.Context, context.CancelFunc)
- func MakeProtoPath(target string, path string) string
- func NewAdminServiceClient(ctx context.Context) (admin.ConfigAdminServiceClient, error)
- func NewConfigurationServiceClient(ctx context.Context) (admin.ConfigurationServiceClient, error)
- func NewOnosConfigGNMIClientOrFail(ctx context.Context, t *testing.T, retryOption RetryOption) gnmiclient.Impl
- func NewSimulatorGNMIClientOrFail(ctx context.Context, t *testing.T, simulator *helm.HelmRelease) gnmiclient.Impl
- func NewSimulatorTargetEntity(ctx context.Context, simulator *helm.HelmRelease, targetType string, ...) (*topo.Object, error)
- func NewTargetEntity(name string, targetType string, targetVersion string, serviceAddress string) (*topo.Object, error)
- func NewTopoClient() (toposdk.Client, error)
- func NewTransactionServiceClient(ctx context.Context) (admin.TransactionServiceClient, error)
- func SyncExtension(t *testing.T) []*gnmi_ext.Extension
- func TransactionStrategyExtension(t *testing.T, synchronicity configapi.TransactionStrategy_Synchronicity, ...) *gnmi_ext.Extension
- func WaitForControlRelation(ctx context.Context, t *testing.T, ...) bool
- func WaitForRollback(ctx context.Context, t *testing.T, transactionIndex v2.Index, ...) bool
- func WaitForTargetAvailable(ctx context.Context, t *testing.T, objectID topo.ID, timeout time.Duration) bool
- func WaitForTargetUnavailable(ctx context.Context, t *testing.T, objectID topo.ID, timeout time.Duration) bool
- type GetRequest
- type RetryOption
- type SetRequest
Constants ¶
const ( // SimulatorTargetVersion default version for simulated target SimulatorTargetVersion = "1.0.0" // SimulatorTargetType type for simulated target SimulatorTargetType = "devicesim" )
Variables ¶
This section is empty.
Functions ¶
func AddTargetToTopo ¶ added in v0.10.13
AddTargetToTopo adds a new target to topo
func CreateSimulator ¶ added in v0.6.0
CreateSimulator creates a device simulator
func CreateSimulatorWithName ¶ added in v0.6.0
func CreateSimulatorWithName(ctx context.Context, t *testing.T, name string, createTopoEntity bool) *helm.HelmRelease
CreateSimulatorWithName creates a device simulator
func DeleteSimulator ¶ added in v0.6.0
func DeleteSimulator(t *testing.T, simulator *helm.HelmRelease)
DeleteSimulator shuts down the simulator pod and removes the target from topology
func GetOnosConfigDestination ¶ added in v0.10.13
func GetOnosConfigDestination() (gnmiclient.Destination, error)
GetOnosConfigDestination returns a gnmi Destination for the onos-config service
func GetTargetPath ¶ added in v0.10.13
func GetTargetPath(target string, path string) []protoutils.TargetPath
GetTargetPath creates a target path
func GetTargetPathWithValue ¶ added in v0.10.13
func GetTargetPathWithValue(target string, path string, value string, valueType string) []protoutils.TargetPath
GetTargetPathWithValue creates a target path with a value to set
func GetTargetPaths ¶ added in v0.10.13
func GetTargetPaths(targets []string, paths []string) []protoutils.TargetPath
GetTargetPaths creates multiple target paths
func GetTargetPathsWithValues ¶ added in v0.10.13
func GetTargetPathsWithValues(targets []string, paths []string, values []string) []protoutils.TargetPath
GetTargetPathsWithValues creates multiple target paths with values to set
func MakeContext ¶
func MakeContext() (context.Context, context.CancelFunc)
MakeContext returns a new context for use in GNMI requests
func MakeProtoPath ¶
MakeProtoPath returns a Path: element for a given target and Path
func NewAdminServiceClient ¶ added in v0.6.0
func NewAdminServiceClient(ctx context.Context) (admin.ConfigAdminServiceClient, error)
NewAdminServiceClient :
func NewConfigurationServiceClient ¶ added in v0.10.13
func NewConfigurationServiceClient(ctx context.Context) (admin.ConfigurationServiceClient, error)
NewConfigurationServiceClient returns configuration store client
func NewOnosConfigGNMIClientOrFail ¶ added in v0.10.20
func NewOnosConfigGNMIClientOrFail(ctx context.Context, t *testing.T, retryOption RetryOption) gnmiclient.Impl
NewOnosConfigGNMIClientOrFail makes a GNMI client to use for requests. If creating the client fails, the test is failed.
func NewSimulatorGNMIClientOrFail ¶ added in v0.10.20
func NewSimulatorGNMIClientOrFail(ctx context.Context, t *testing.T, simulator *helm.HelmRelease) gnmiclient.Impl
NewSimulatorGNMIClientOrFail creates a GNMI client to a target. If there is an error, the test is failed
func NewSimulatorTargetEntity ¶ added in v0.10.13
func NewSimulatorTargetEntity(ctx context.Context, simulator *helm.HelmRelease, targetType string, targetVersion string) (*topo.Object, error)
NewSimulatorTargetEntity creates a topo entity for a device simulator target
func NewTargetEntity ¶ added in v0.10.15
func NewTargetEntity(name string, targetType string, targetVersion string, serviceAddress string) (*topo.Object, error)
NewTargetEntity creates a topo entity with the specified target name, type, version and service address
func NewTopoClient ¶ added in v0.7.1
NewTopoClient creates a topology client
func NewTransactionServiceClient ¶ added in v0.10.13
func NewTransactionServiceClient(ctx context.Context) (admin.TransactionServiceClient, error)
NewTransactionServiceClient :
func SyncExtension ¶ added in v0.10.15
SyncExtension returns list of extensions with just the transaction mode extension set to sync and atomic.
func TransactionStrategyExtension ¶ added in v0.10.18
func TransactionStrategyExtension(t *testing.T, synchronicity configapi.TransactionStrategy_Synchronicity, isolation configapi.TransactionStrategy_Isolation) *gnmi_ext.Extension
TransactionStrategyExtension returns a transaction strategy extension populated with the specified fields
func WaitForControlRelation ¶ added in v0.10.19
func WaitForControlRelation(ctx context.Context, t *testing.T, predicate func(*topo.Relation, topo.Event) bool, timeout time.Duration) bool
WaitForControlRelation waits to create control relation for a given target
func WaitForRollback ¶ added in v0.10.13
func WaitForRollback(ctx context.Context, t *testing.T, transactionIndex v2.Index, wait time.Duration) bool
WaitForRollback waits for a COMPLETED status on the most recent rollback transaction
Types ¶
type GetRequest ¶ added in v0.10.20
type GetRequest struct {
Ctx context.Context
Client gnmiclient.Impl
Paths []protoutils.TargetPath
Extensions []*gnmi_ext.Extension
Encoding gnmiapi.Encoding
DataType gnmiapi.GetRequest_DataType
}
GetRequest represents a GNMI Get request
func (*GetRequest) CheckValue ¶ added in v0.10.20
func (req *GetRequest) CheckValue(t *testing.T, expectedValue string)
CheckValue checks that the correct value is read back via a gnmi get request
func (*GetRequest) CheckValueDeleted ¶ added in v0.10.20
func (req *GetRequest) CheckValueDeleted(t *testing.T)
CheckValueDeleted makes sure that the specified paths have been removed
func (*GetRequest) Get ¶ added in v0.10.20
func (req *GetRequest) Get() ([]protoutils.TargetPath, error)
Get performs a Get operation
type RetryOption ¶ added in v0.10.18
type RetryOption int
RetryOption specifies if a client should retry request errors
const ( // NoRetry do not attempt to retry NoRetry RetryOption = iota // WithRetry adds a retry option to the client WithRetry )
type SetRequest ¶ added in v0.10.20
type SetRequest struct {
Ctx context.Context
Client gnmiclient.Impl
UpdatePaths []protoutils.TargetPath
DeletePaths []protoutils.TargetPath
Extensions []*gnmi_ext.Extension
Encoding gnmiapi.Encoding
}
SetRequest represents a GNMI Set request
func (*SetRequest) Set ¶ added in v0.10.20
func (req *SetRequest) Set() (configapi.TransactionID, v2.Index, error)
Set performs a Set operation
func (*SetRequest) SetOrFail ¶ added in v0.10.21
func (req *SetRequest) SetOrFail(t *testing.T) (configapi.TransactionID, v2.Index)
SetOrFail performs a Set operation and fails the test if an error occurs