Documentation
¶
Index ¶
- Constants
- Variables
- func AddTargetToTopo(targetEntity *topo.Object) error
- func CheckGNMIValue(t *testing.T, gnmiClient gnmiclient.Impl, paths []protoutils.TargetPath, ...)
- func CheckGNMIValueWithContext(ctx context.Context, t *testing.T, gnmiClient gnmiclient.Impl, ...)
- func CheckGNMIValues(t *testing.T, gnmiClient gnmiclient.Impl, paths []protoutils.TargetPath, ...)
- func CheckTargetValue(t *testing.T, targetGnmiClient gnmiclient.Impl, ...)
- func CreateSimulator(t *testing.T) *helm.HelmRelease
- func CreateSimulatorWithName(t *testing.T, name string) *helm.HelmRelease
- func DeleteSimulator(t *testing.T, simulator *helm.HelmRelease)
- func GetGNMIClientOrFail(t *testing.T) gnmiclient.Impl
- func GetGNMIClientWithContextOrFail(ctx context.Context, t *testing.T) gnmiclient.Impl
- func GetGNMIValue(ctx context.Context, c gnmiclient.Impl, paths []protoutils.TargetPath, ...) ([]protoutils.TargetPath, []*gnmi_ext.Extension, error)
- func GetOnosConfigDestination() (gnmiclient.Destination, error)
- func GetSimulatorExtensions() []*gnmi_ext.Extension
- func GetSimulatorTarget(simulator *helm.HelmRelease) (*topo.Object, error)
- func GetTargetGNMIClientOrFail(t *testing.T, simulator *helm.HelmRelease) gnmiclient.Impl
- 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
- func MakeProtoPath(target string, path string) string
- func NewAdminServiceClient() (admin.ConfigAdminServiceClient, error)
- func NewConfigurationServiceClient() (admin.ConfigurationServiceClient, error)
- func NewSimulatorTargetEntity(simulator *helm.HelmRelease, targetType string, targetVersion string) (*topo.Object, error)
- func NewTopoClient() (toposdk.Client, error)
- func NewTransactionServiceClient() (admin.TransactionServiceClient, error)
- func SetGNMIValue(ctx context.Context, c gnmiclient.Impl, updatePaths []protoutils.TargetPath, ...) (string, []*gnmi_ext.Extension, error)
- func SetGNMIValueOrFail(t *testing.T, gnmiClient gnmiclient.Impl, updatePaths []protoutils.TargetPath, ...) (configapi.TransactionID, v2.Index)
- func SetGNMIValueWithContext(ctx context.Context, t *testing.T, gnmiClient gnmiclient.Impl, ...) (configapi.TransactionID, v2.Index, error)
- func SetGNMIValueWithContextOrFail(ctx context.Context, t *testing.T, gnmiClient gnmiclient.Impl, ...) (configapi.TransactionID, v2.Index)
- func WaitForConfigurationCompleteOrFail(t *testing.T, configurationID configapi.ConfigurationID, wait time.Duration) error
- func WaitForRollback(t *testing.T, transactionIndex v2.Index, wait time.Duration) bool
- func WaitForTarget(t *testing.T, predicate func(*topo.Relation, topo.EventType) bool, ...) bool
- func WaitForTargetAvailable(t *testing.T, objectID topo.ID, timeout time.Duration) bool
- func WaitForTargetUnavailable(t *testing.T, objectID topo.ID, timeout time.Duration) bool
Constants ¶
const ( // SimulatorTargetVersion default version for simulated target SimulatorTargetVersion = "1.0.0" // SimulatorTargetType type for simulated target SimulatorTargetType = "devicesim-1.0.x" )
Variables ¶
var NoExtensions = make([]*gnmi_ext.Extension, 0)
NoExtensions can be used on a request that does not need extension values
var NoPaths = make([]protoutils.TargetPath, 0)
NoPaths can be used on a request that does not need path values
Functions ¶
func AddTargetToTopo ¶ added in v0.10.13
AddTargetToTopo adds a new target to topo
func CheckGNMIValue ¶
func CheckGNMIValue(t *testing.T, gnmiClient gnmiclient.Impl, paths []protoutils.TargetPath, expectedValue string, expectedExtensions int, failMessage string)
CheckGNMIValue makes sure a value has been assigned properly by querying the onos-config northbound API
func CheckGNMIValueWithContext ¶ added in v0.10.10
func CheckGNMIValueWithContext(ctx context.Context, t *testing.T, gnmiClient gnmiclient.Impl, paths []protoutils.TargetPath, expectedValue string, expectedExtensions int, failMessage string)
CheckGNMIValueWithContext makes sure a value has been assigned properly by querying the onos-config northbound API
func CheckGNMIValues ¶
func CheckGNMIValues(t *testing.T, gnmiClient gnmiclient.Impl, paths []protoutils.TargetPath, expectedValues []string, expectedExtensions int, failMessage string)
CheckGNMIValues makes sure a list of values has been assigned properly by querying the onos-config northbound API
func CheckTargetValue ¶ added in v0.10.13
func CheckTargetValue(t *testing.T, targetGnmiClient gnmiclient.Impl, targetPaths []protoutils.TargetPath, expectedValue string)
CheckTargetValue makes sure a value has been assigned properly to a target path by querying GNMI
func CreateSimulator ¶ added in v0.6.0
func CreateSimulator(t *testing.T) *helm.HelmRelease
CreateSimulator creates a device simulator
func CreateSimulatorWithName ¶ added in v0.6.0
func CreateSimulatorWithName(t *testing.T, name string) *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 GetGNMIClientOrFail ¶
func GetGNMIClientOrFail(t *testing.T) gnmiclient.Impl
GetGNMIClientOrFail makes a GNMI client to use for requests. If creating the client fails, the test is failed.
func GetGNMIClientWithContextOrFail ¶ added in v0.10.10
GetGNMIClientWithContextOrFail makes a GNMI client to use for requests. If creating the client fails, the test is failed.
func GetGNMIValue ¶
func GetGNMIValue(ctx context.Context, c gnmiclient.Impl, paths []protoutils.TargetPath, encoding gpb.Encoding) ([]protoutils.TargetPath, []*gnmi_ext.Extension, error)
GetGNMIValue generates a GET request on the given client for a Path on a target
func GetOnosConfigDestination ¶ added in v0.10.13
func GetOnosConfigDestination() (gnmiclient.Destination, error)
GetOnosConfigDestination :
func GetSimulatorExtensions ¶
GetSimulatorExtensions creates the default set of extensions for a simulated target
func GetSimulatorTarget ¶ added in v0.10.13
func GetSimulatorTarget(simulator *helm.HelmRelease) (*topo.Object, error)
GetSimulatorTarget queries topo to find the topo object for a simulator target
func GetTargetGNMIClientOrFail ¶ added in v0.10.13
func GetTargetGNMIClientOrFail(t *testing.T, simulator *helm.HelmRelease) gnmiclient.Impl
GetTargetGNMIClientOrFail creates a GNMI client to a target. If there is an error, the test is failed
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 ¶
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() (admin.ConfigAdminServiceClient, error)
NewAdminServiceClient :
func NewConfigurationServiceClient ¶ added in v0.10.13
func NewConfigurationServiceClient() (admin.ConfigurationServiceClient, error)
NewConfigurationServiceClient returns configuration store client
func NewSimulatorTargetEntity ¶ added in v0.10.13
func NewSimulatorTargetEntity(simulator *helm.HelmRelease, targetType string, targetVersion string) (*topo.Object, error)
NewSimulatorTargetEntity creates a topo entity for a device simulator target
func NewTopoClient ¶ added in v0.7.1
NewTopoClient creates a topology client
func NewTransactionServiceClient ¶ added in v0.10.13
func NewTransactionServiceClient() (admin.TransactionServiceClient, error)
NewTransactionServiceClient :
func SetGNMIValue ¶
func SetGNMIValue(ctx context.Context, c gnmiclient.Impl, updatePaths []protoutils.TargetPath, deletePaths []protoutils.TargetPath, extensions []*gnmi_ext.Extension) (string, []*gnmi_ext.Extension, error)
SetGNMIValue generates a SET request on the given client for update and delete paths on a target
func SetGNMIValueOrFail ¶
func SetGNMIValueOrFail(t *testing.T, gnmiClient gnmiclient.Impl, updatePaths []protoutils.TargetPath, deletePaths []protoutils.TargetPath, extensions []*gnmi_ext.Extension) (configapi.TransactionID, v2.Index)
SetGNMIValueOrFail does a GNMI set operation to the given client, and fails the test if there is an error
func SetGNMIValueWithContext ¶ added in v0.10.10
func SetGNMIValueWithContext(ctx context.Context, t *testing.T, gnmiClient gnmiclient.Impl, updatePaths []protoutils.TargetPath, deletePaths []protoutils.TargetPath, extensions []*gnmi_ext.Extension) (configapi.TransactionID, v2.Index, error)
SetGNMIValueWithContext does a GNMI set operation to the given client, and fails the test if there is an error
func SetGNMIValueWithContextOrFail ¶ added in v0.10.10
func SetGNMIValueWithContextOrFail(ctx context.Context, t *testing.T, gnmiClient gnmiclient.Impl, updatePaths []protoutils.TargetPath, deletePaths []protoutils.TargetPath, extensions []*gnmi_ext.Extension) (configapi.TransactionID, v2.Index)
SetGNMIValueWithContextOrFail does a GNMI set operation to the given client, and fails the test if there is an error
func WaitForConfigurationCompleteOrFail ¶ added in v0.10.13
func WaitForConfigurationCompleteOrFail(t *testing.T, configurationID configapi.ConfigurationID, wait time.Duration) error
WaitForConfigurationCompleteOrFail wait for a configuration to complete or fail
func WaitForRollback ¶ added in v0.10.13
WaitForRollback waits for a COMPLETED status on the most recent rollback transaction
func WaitForTarget ¶ added in v0.10.13
func WaitForTarget(t *testing.T, predicate func(*topo.Relation, topo.EventType) bool, timeout time.Duration) bool
WaitForTarget waits for a target to match the given predicate
func WaitForTargetAvailable ¶ added in v0.10.13
WaitForTargetAvailable waits for a target to become available
Types ¶
This section is empty.