suite

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InlineXML added in v0.1.2

func InlineXML(ts *TestSuite) error

InlineXML iterates over a testsuite looking for inline file tag, on finding it will attempt to load and replace with inline xml

func StringInSlice added in v0.1.1

func StringInSlice(a string, list []string) bool

StringInSlice helper function to test if a slice contains a value

Types

type Action

type Action struct {
	Netconf *Netconf `json:"netconf,omitempty" yaml:"netconf,omitempty"`
	Sleep   *Sleep   `json:"sleep,omitempty" yaml:"sleep,omitempty"`
}

Action is a wrapper for the different actions types (netconf, sleep)

type Block

type Block struct {
	Type    string   `json:"type" yaml:"type"`
	Actions []Action `json:"actions" yaml:"actions"`
}

Block describes a list of actions and how these should treated; as an init block, sequentially or concurrently

type Configs

type Configs []Sshconfig

Configs rebinds the slice of Sshconfig so that methods can be constructed against it

func (Configs) IsReuseConnection

func (c Configs) IsReuseConnection(hostname string) bool

IsReuseConnection iterates through the Config slice and matches on host returning whether the connection should be reused or not

type Filter

type Filter struct {
	Type   string  `json:"type" yaml:"type"`
	Ns     *string `json:"ns,omitempty" yaml:"ns,omitempty"`
	Select string  `json:"select" yaml:"select"`
}

Filter defines the parameters required to generate a subtree or xpath filter within a NETCONF Request

type Netconf

type Netconf struct {
	Hostname  string  `json:"hostname" yaml:"hostname"`
	Message   *string `json:"message,omitempty" yaml:"message,omitempty"`
	Method    *string `json:"method,omitempty" yaml:"method,omitempty"`
	Operation *string `json:"operation,omitempty" yaml:"operation,omitempty"`
	Source    *string `json:"source,omitempty" yaml:"source,omitempty"`
	Target    *string `json:"target,omitempty" yaml:"target,omitempty"`
	Filter    *Filter `json:"filter,omitempty" yaml:"filter,omitempty"`
	Config    *string `json:"config,omitempty" yaml:"config,omitempty"`
	Expected  *string `json:"expected,omitempty" yaml:"expected,omitempty"`
}

Netconf struct contains information required to construct a valid NETCONF Operation. Addresses are used to indicate optional content

func (*Netconf) ToXMLString

func (n *Netconf) ToXMLString() (string, error)

ToXMLString generates a XML representation of the information provided in the Netconf section of the TestSuite

type Sleep

type Sleep struct {
	Duration int `json:"duration" yaml:"duration"` // seconds
}

Sleep is an action instructing the client to sleep for the period defined in duration

type Sshconfig

type Sshconfig struct {
	Hostname        string `json:"hostname" yaml:"hostname"`
	Port            int    `json:"port" yaml:"port"`
	Username        string `json:"username" yaml:"username"`
	Password        string `json:"password" yaml:"password"`
	Reuseconnection bool   `json:"reuseconnection" yaml:"reuseconnection"`
}

Sshconfig defines a definition for the parameters required to connect to a NETCONF Agent via SSH

type TestSuite

type TestSuite struct {
	File       string  `json:"-" yaml:"-"`
	Iterations int     `json:"iterations" yaml:"iterations"`
	Clients    int     `json:"clients" yaml:"clients"`
	Rampup     int     `json:"rampup" yaml:"rampup"`
	Configs    Configs `json:"configs" yaml:"configs"`
	Blocks     []Block `json:"blocks" yaml:"blocks"`
}

TestSuite is the top level struct for the yaml document definition

func NewTestSuite

func NewTestSuite(file string) (*TestSuite, error)

NewTestSuite returns an TestSuite initialized from a yaml file

func (*TestSuite) GetConfig

func (ts *TestSuite) GetConfig(hostname string) *Sshconfig

GetConfig returns the connection information for a specific host

func (*TestSuite) GetInitBlock

func (ts *TestSuite) GetInitBlock() *Block

GetInitBlock returns an init block if defined in the TestSuite

Jump to

Keyboard shortcuts

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