testers

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factories = make(map[string]func(cfg *config.Config, test *config.Test) (Tester, error))

Factories contains the list of all available testers. The tester can each then be created using the function saved in the map.

Functions

This section is empty.

Types

type Environment

type Environment struct {
	Hosts *Hosts
}

Environment environment information such as which hosts are doing what (clients, servers)

type Host

type Host struct {
	Name      string            `json:"name"`
	Labels    map[string]string `json:"labels"`
	Addresses *IPAddresses      `json:"addresses"`
}

Host host information, like labels and addresses (will most of the time be filled by the runners.Runner)

type Hosts

type Hosts struct {
	Clients map[string]*Host `yaml:"clients"`
	Servers map[string]*Host `yaml:"servers"`
}

Hosts contains a list of clients and servers hosts that will be used in the test environment.

type IPAddresses

type IPAddresses struct {
	IPv4 []string `json:"ipv4"`
	IPv6 []string `json:"ipv6"`
}

IPAddresses list of IPv4 and IPv6 addresses a host has

type Plan

type Plan struct {
	TestStartTime   time.Time         `json:"plannedTime"`
	AffectedServers map[string]*Host  `json:"affectedServers"`
	Commands        [][]*Task         `json:"commands"`
	Tester          string            `json:"tester"`
	RunOptions      config.RunOptions `json:"runOptions"`
}

Plan contains the information needed to execute the plan

func (Plan) PrettyPrint

func (p Plan) PrettyPrint()

PrettyPrint "pretty" prints a plan

type Ports

type Ports struct {
	TCP []int32
	UDP []int32
}

Ports TCP and UDP ports list

type Status

type Status struct {
	SuccessfulHosts StatusHosts        `json:"successfulHosts"`
	FailedHosts     StatusHosts        `json:"failedHosts"`
	Errors          map[string][]error `json:"errors"`
}

Status status info for a task

func (*Status) AddFailedClient

func (st *Status) AddFailedClient(host *Host, err error)

AddFailedClient add a client host that failed with error to the Status list

func (*Status) AddFailedServer

func (st *Status) AddFailedServer(host *Host, err error)

AddFailedServer add a server host that failed with error to the Status list

func (*Status) AddSuccessfulClient

func (st *Status) AddSuccessfulClient(host *Host)

AddSuccessfulClient add a successful client host to the list

func (*Status) AddSuccessfulServer

func (st *Status) AddSuccessfulServer(host *Host)

AddSuccessfulServer add a successful server host to the list

type StatusHosts

type StatusHosts struct {
	Servers map[string]int `json:"servers"`
	Clients map[string]int `json:"clients"`
}

StatusHosts status per servers and clients list with counter

type Task

type Task struct {
	Host     *Host         `json:"host"`
	Command  string        `json:"command"`
	Args     []string      `json:"args"`
	Sleep    time.Duration `json:"sleep"`
	Ports    Ports         `json:"ports"`
	SubTasks []*Task       `json:"subTasks"`
	Status   *Status       `yaml:"status"`
}

Task information for the task to execute

type Tester

type Tester interface {
	// Plan return a map of commands and on which servers to run them thanks to the info of the runners.Runner
	Plan(env *Environment, test *config.Test) (*Plan, error)
}

Tester is the interface a tester has to implement

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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