gnmi

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 23 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoExtensions = make([]*gnmi_ext.Extension, 0)

NoExtensions can be used on a request that does not need extension values

View Source
var NoPaths = make([]protoutils.DevicePath, 0)

NoPaths can be used on a request that does not need path values

Functions

func CheckDeviceValue

func CheckDeviceValue(t *testing.T, deviceGnmiClient client.Impl, devicePaths []protoutils.DevicePath, expectedValue string)

CheckDeviceValue makes sure a value has been assigned properly to a device path by querying GNMI

func CheckGNMIValue

func CheckGNMIValue(t *testing.T, gnmiClient client.Impl, paths []protoutils.DevicePath, expectedValue string, expectedExtensions int, failMessage string)

CheckGNMIValue makes sure a value has been assigned properly by querying the onos-config northbound API

func CheckGNMIValues

func CheckGNMIValues(t *testing.T, gnmiClient client.Impl, paths []protoutils.DevicePath, 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 GetDeviceGNMIClientOrFail

func GetDeviceGNMIClientOrFail(t *testing.T, simulator env.SimulatorEnv) client.Impl

GetDeviceGNMIClientOrFail creates a GNMI client to a device. If there is an error, the test is failed

func GetDevicePath

func GetDevicePath(device string, path string) []protoutils.DevicePath

GetDevicePath creates a device path

func GetDevicePathWithValue

func GetDevicePathWithValue(device string, path string, value string, valueType string) []protoutils.DevicePath

GetDevicePathWithValue creates a device path with a value to set

func GetDevicePaths

func GetDevicePaths(devices []string, paths []string) []protoutils.DevicePath

GetDevicePaths creates multiple device paths

func GetDevicePathsWithValues

func GetDevicePathsWithValues(devices []string, paths []string, values []string) []protoutils.DevicePath

GetDevicePathsWithValues creates multiple device paths with values to set

func GetGNMIClientOrFail

func GetGNMIClientOrFail(t *testing.T) client.Impl

GetGNMIClientOrFail makes a GNMI client to use for requests. If creating the client fails, the test is failed.

func GetGNMIValue

GetGNMIValue generates a GET request on the given client for a Path on a device

func GetSimulatorExtensions

func GetSimulatorExtensions() []*gnmi_ext.Extension

GetSimulatorExtensions creates the default set of extensions for a simulated device

func MakeContext

func MakeContext() context.Context

MakeContext returns a new context for use in GNMI requests

func MakeProtoPath

func MakeProtoPath(target string, path string) string

MakeProtoPath returns a Path: element for a given target and Path

func SetGNMIValue

func SetGNMIValue(ctx context.Context, c client.Impl, updatePaths []protoutils.DevicePath, deletePaths []protoutils.DevicePath, 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 device

func SetGNMIValueOrFail

func SetGNMIValueOrFail(t *testing.T, gnmiClient client.Impl,
	updatePaths []protoutils.DevicePath, deletePaths []protoutils.DevicePath,
	extensions []*gnmi_ext.Extension) network.ID

SetGNMIValueOrFail does a GNMI set operation to the given client, and fails the test if there is an error

func WaitForDevice

func WaitForDevice(t *testing.T, predicate func(*device.Device) bool, timeout time.Duration) bool

WaitForDevice waits for a device to match the given predicate

func WaitForDeviceAvailable

func WaitForDeviceAvailable(t *testing.T, deviceID device.ID, timeout time.Duration) bool

WaitForDeviceAvailable waits for a device to become available

func WaitForDeviceUnavailable

func WaitForDeviceUnavailable(t *testing.T, deviceID device.ID, timeout time.Duration) bool

WaitForDeviceUnavailable waits for a device to become available

func WaitForNetworkChangeComplete

func WaitForNetworkChangeComplete(t *testing.T, networkChangeID network.ID, wait time.Duration) bool

WaitForNetworkChangeComplete waits for a COMPLETED status on the given change

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL