cmdrunner

package
v0.0.0-...-4982e5b Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stepper

func Stepper(cmds []Runner) error

Stepper steps through a list of runners, grabbing and comparing the received data while validating success.

Types

type CompareError

type CompareError struct {
	// contains filtered or unexported fields
}

CompareError is a composite struct to ensure what was got matches what was expected for a given command.

func (*CompareError) Error

func (ce *CompareError) Error() string

Error is a customer error method for comparison checks.

type ISISAdjacencyRpcReply

type ISISAdjacencyRpcReply struct {
	Target                   string
	ExpectedNeighbor         string
	IsisAdjacencyInformation struct {
		Text          string `xml:",chardata"`
		Xmlns         string `xml:"xmlns,attr"`
		Style         string `xml:"style,attr"`
		IsisAdjacency struct {
			Text           string `xml:",chardata"`
			InterfaceName  string `xml:"interface-name"`
			SystemName     string `xml:"system-name"`
			Level          string `xml:"level"`
			AdjacencyState string `xml:"adjacency-state"`
			Holdtime       string `xml:"holdtime"`
		} `xml:"isis-adjacency"`
	} `xml:"isis-adjacency-information"`
}

ISISAdjacencyRpcReply represents an ISIS neighbor.

func (*ISISAdjacencyRpcReply) Compare

func (ia *ISISAdjacencyRpcReply) Compare() error

Compare compares the received output with the expected output.

func (*ISISAdjacencyRpcReply) Run

func (ia *ISISAdjacencyRpcReply) Run() error

Run attempts to open a connection to a remote target and get the ISIS adjacency output and convert it to a native go struct.

func (*ISISAdjacencyRpcReply) String

func (ia *ISISAdjacencyRpcReply) String() string

String identifies the type of command to the caller.

type Runner

type Runner interface {
	Run() error
	Compare() error
}

Runner provides the neccessary methods to collect and compare data from a target device.

type SpecificRouteRpcReply

type SpecificRouteRpcReply struct {
	Target           string
	Prefix           string
	ExpectedNextHop  string
	RouteInformation struct {
		Text       string `xml:",chardata"`
		Xmlns      string `xml:"xmlns,attr"`
		RouteTable struct {
			Text               string `xml:",chardata"`
			TableName          string `xml:"table-name"`
			DestinationCount   string `xml:"destination-count"`
			TotalRouteCount    string `xml:"total-route-count"`
			ActiveRouteCount   string `xml:"active-route-count"`
			HolddownRouteCount string `xml:"holddown-route-count"`
			HiddenRouteCount   string `xml:"hidden-route-count"`
			Rt                 struct {
				Text          string `xml:",chardata"`
				Style         string `xml:"style,attr"`
				RtDestination string `xml:"rt-destination"`
				RtEntry       struct {
					Text          string `xml:",chardata"`
					ActiveTag     string `xml:"active-tag"`
					CurrentActive string `xml:"current-active"`
					LastActive    string `xml:"last-active"`
					ProtocolName  string `xml:"protocol-name"`
					Preference    string `xml:"preference"`
					Age           struct {
						Text    string `xml:",chardata"`
						Seconds string `xml:"seconds,attr"`
					} `xml:"age"`
					Metric string `xml:"metric"`
					Nh     struct {
						Text            string `xml:",chardata"`
						SelectedNextHop string `xml:"selected-next-hop"`
						To              string `xml:"to"`
						Via             string `xml:"via"`
					} `xml:"nh"`
				} `xml:"rt-entry"`
			} `xml:"rt"`
		} `xml:"route-table"`
	} `xml:"route-information"`
}

SpecificRouteRpcReply represents a specific juniper route in the routing table.

func (*SpecificRouteRpcReply) Compare

func (sr *SpecificRouteRpcReply) Compare() error

Compare compares the received output with the expected output.

func (*SpecificRouteRpcReply) Run

func (sr *SpecificRouteRpcReply) Run() error

Run attempts to open a connection to a remote target and get the output for a specific route convert it to a native go struct.

func (*SpecificRouteRpcReply) String

func (sr *SpecificRouteRpcReply) String() string

String identifies the type of command to the caller.

Jump to

Keyboard shortcuts

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