Documentation ¶
Index ¶
- Constants
- Variables
- func AddDeviceToTopo(d *device.Device) error
- func AwaitDeviceState(simulator *helm.HelmRelease, predicate func(*device.Device) bool) error
- func CheckDeviceValue(t *testing.T, deviceGnmiClient client.Impl, ...)
- func CheckGNMIValue(t *testing.T, gnmiClient client.Impl, paths []protoutils.DevicePath, ...)
- func CheckGNMIValues(t *testing.T, gnmiClient client.Impl, paths []protoutils.DevicePath, ...)
- 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 GetDestination() (client.Destination, error)
- func GetDevice(simulator *helm.HelmRelease) (*device.Device, error)
- func GetDeviceDestination(simulator *helm.HelmRelease) (client.Destination, error)
- func GetDeviceGNMIClientOrFail(t *testing.T, simulator *helm.HelmRelease) client.Impl
- func GetDevicePath(device string, path string) []protoutils.DevicePath
- func GetDevicePathWithValue(device string, path string, value string, valueType string) []protoutils.DevicePath
- func GetDevicePaths(devices []string, paths []string) []protoutils.DevicePath
- func GetDevicePathsWithValues(devices []string, paths []string, values []string) []protoutils.DevicePath
- func GetGNMIClientOrFail(t *testing.T) client.Impl
- func GetGNMIValue(ctx context.Context, c client.Impl, paths []protoutils.DevicePath) ([]protoutils.DevicePath, []*gnmi_ext.Extension, error)
- func GetSimulatorExtensions() []*gnmi_ext.Extension
- func MakeContext() context.Context
- func MakeProtoPath(target string, path string) string
- func NewAdminServiceClient() (admin.ConfigAdminServiceClient, error)
- func NewChangeServiceClient() (diags.ChangeServiceClient, error)
- func NewDevice(simulator *helm.HelmRelease, deviceType string, version string) (*device.Device, error)
- func NewDeviceServiceClient() (device.DeviceServiceClient, error)
- func NewOpStateDiagsClient() (diags.OpStateDiagsClient, error)
- func RemoveDeviceFromTopo(d *device.Device) error
- func SetGNMIValue(ctx context.Context, c client.Impl, updatePaths []protoutils.DevicePath, ...) (string, []*gnmi_ext.Extension, error)
- func SetGNMIValueOrFail(t *testing.T, gnmiClient client.Impl, updatePaths []protoutils.DevicePath, ...) network.ID
- func WaitForDevice(t *testing.T, predicate func(*device.Device) bool, timeout time.Duration) bool
- func WaitForDeviceAvailable(t *testing.T, deviceID device.ID, timeout time.Duration) bool
- func WaitForDeviceUnavailable(t *testing.T, deviceID device.ID, timeout time.Duration) bool
- func WaitForNetworkChangeComplete(t *testing.T, networkChangeID network.ID, wait time.Duration) bool
Constants ¶
const ( // SimulatorDeviceVersion default version for simulated device SimulatorDeviceVersion = "1.0.0" // SimulatorDeviceType type for simulated device SimulatorDeviceType = "Devicesim" )
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.DevicePath, 0)
NoPaths can be used on a request that does not need path values
Functions ¶
func AwaitDeviceState ¶
AwaitDeviceState :
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 CreateSimulator ¶
func CreateSimulator(t *testing.T) *helm.HelmRelease
CreateSimulator creates a device simulator
func CreateSimulatorWithName ¶
func CreateSimulatorWithName(t *testing.T, name string) *helm.HelmRelease
CreateSimulatorWithName creates a device simulator
func DeleteSimulator ¶
func DeleteSimulator(t *testing.T, simulator *helm.HelmRelease)
DeleteSimulator shuts down the simulator pod and removes the device from topology
func GetDeviceDestination ¶
func GetDeviceDestination(simulator *helm.HelmRelease) (client.Destination, error)
GetDeviceDestination :
func GetDeviceGNMIClientOrFail ¶
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 ¶
GetGNMIClientOrFail 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 client.Impl, paths []protoutils.DevicePath) ([]protoutils.DevicePath, []*gnmi_ext.Extension, error)
GetGNMIValue generates a GET request on the given client for a Path on a device
func GetSimulatorExtensions ¶
GetSimulatorExtensions creates the default set of extensions for a simulated device
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 ¶
func NewAdminServiceClient() (admin.ConfigAdminServiceClient, error)
NewAdminServiceClient :
func NewChangeServiceClient ¶
func NewChangeServiceClient() (diags.ChangeServiceClient, error)
NewChangeServiceClient :
func NewDevice ¶
func NewDevice(simulator *helm.HelmRelease, deviceType string, version string) (*device.Device, error)
NewDevice :
func NewDeviceServiceClient ¶
func NewDeviceServiceClient() (device.DeviceServiceClient, error)
NewDeviceServiceClient :
func NewOpStateDiagsClient ¶
func NewOpStateDiagsClient() (diags.OpStateDiagsClient, error)
NewOpStateDiagsClient :
func RemoveDeviceFromTopo ¶
RemoveDeviceFromTopo :
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 ¶
WaitForDevice waits for a device to match the given predicate
func WaitForDeviceAvailable ¶
WaitForDeviceAvailable waits for a device to become available
func WaitForDeviceUnavailable ¶
WaitForDeviceUnavailable waits for a device to become available
Types ¶
This section is empty.