Documentation
¶
Overview ¶
Package solver provides a library for solving a testbed reservation request against a given inventory of available devices and their connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssignmentToReservation ¶ added in v0.12.3
func AssignmentToReservation(solveResult *SolveResult, tb *opb.Testbed) (*binding.Reservation, error)
AssignmentToReservation converts the solveResult to a binding.Reservation.
Types ¶
type Inventory ¶
type Inventory struct {
DUTs []binding.DUT
ATEs []binding.ATE
Links map[*binding.Port]*binding.Port // Maps a port to its peer.
}
Inventory of available binding devices and links. This struct is provided by a specific binding implementation.
type SolveResult ¶
type SolveResult struct {
Assignment *portgraph.Assignment
AbsNode2Dev map[*portgraph.AbstractNode]*opb.Device
AbsPort2Port map[*portgraph.AbstractPort]*opb.Port
ConNode2BindDev map[*portgraph.ConcreteNode]*binding.Device
ConPort2BindPort map[*portgraph.ConcretePort]*binding.Port
}
SolveResult contains the result of a successful testbed solve.
func Solve ¶
func Solve(ctx context.Context, tb *opb.Testbed, inv *Inventory, partial map[string]string) (*SolveResult, error)
Solve finds an assignment to the provided testbed from the given inventory. It returns the low-level portgraph.Assignment and maps to correlate graph elements back to the original binding and testbed elements.
Click to show internal directories.
Click to hide internal directories.