binding

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Overview

Package binding wraps knebind to allow running integration tests without the need to supply kne/ondatra flags for configuration files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KNE added in v0.4.0

func KNE(topoDir string) func() (binding.Binding, error)

KNE returns the custom lemming binding. The topoDir is the relative path to a directory containing the Ondatra testbed and KNE topology pb.txt files.

func Local added in v0.4.0

func Local(topoDir string) func() (binding.Binding, error)

Local is a local (in-process) binding for lemming and magna.

Types

type LemmingBind

type LemmingBind struct {
	binding.Binding
	// contains filtered or unexported fields
}

LemmingBind wraps the Ondatra knebind and adds the ability to set the testbed and topology from inside the test. TODO: Add unit tests and upstream some of this to Ondatra.

func (*LemmingBind) Release

func (lb *LemmingBind) Release(ctx context.Context) error

Release runs knebind release then deletes the topology if it was created by this binding.

func (*LemmingBind) Reserve

func (lb *LemmingBind) Reserve(ctx context.Context, tb *opb.Testbed, runTime time.Duration, waitTime time.Duration, partial map[string]string) (*binding.Reservation, error)

Reserve deploys the topology if it doesn't exists, then runs knebind Reserve.

type LocalBind added in v0.4.0

type LocalBind struct {
	binding.Binding
	// contains filtered or unexported fields
}

LocalBind is an Ondatra binding for in-process testbed. Only Lemming and Magna are supported.

func (*LocalBind) Release added in v0.4.0

func (lb *LocalBind) Release(context.Context) error

Release releases the reserved testbed.

func (*LocalBind) Reserve added in v0.4.0

func (lb *LocalBind) Reserve(ctx context.Context, tb *opb.Testbed, _, _ time.Duration, _ map[string]string) (*binding.Reservation, error)

Reserve creates a new local binding.

Jump to

Keyboard shortcuts

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