icmp

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

README

Vigie - Executor Step

Step for execute a Ping Request

Ping Request

Input

In your yaml file, you can use:

Request Parameters
  - host: Host 
  - count: How many ping

Requests Examples

name: Title of TestSuite
testcases:

- name: Ping Localhost
  steps:
  - type: ping
    host: 127.0.0.1
    assertions:
    - result.Contact ShouldContainSubstring OK
    - result.timeseconds ShouldBeLessThan 1


NB: to post a file with multipart_form, prefix the path to the file with '@'

Result Output

    result.Contact
	result.MinRtt 
	result.AvgRtt
	result.Rtt
	result.MaxRtt
	result.PacketLoss
	result.PacketsRecv
	result.IPAddr
Description
  • result.Contact: Réponse au ping
  • result.MinRtt : Mini RTT (en seconde)
  • result.AvgRtt:
  • result.Rtt: RTT is an alias from AvgRTT
  • result.MaxRtt:
  • result.PacketLoss:
  • result.PacketsRecv:
  • result.IPAddr:
  • result.TimeSeconds:
  • result.TimeHuman:
  • result.Err:
Result Example
  • result.Contact: OK
  • result.MinRtt : 0.00011006
  • result.AvgRtt: 0.00020036
  • result.Rtt: RTT is an alias from AvgRTT
  • result.MaxRtt:
  • result.PacketLoss: 0
  • result.PacketsRecv: 5
  • result.IPAddr: 127.0.0.1
  • result.TimeSeconds:
  • result.TimeHuman:
  • result.Err:

Default assertion

result.statuscode ShouldEqual 200

Documentation

Index

Constants

View Source
const Name = "icmp"

Name of executor

Variables

This section is empty.

Functions

func New

func New() probe.Probe

New returns a new Probe

Types

type Probe

type Probe struct {
	Name        string        `json:"name"`
	Host        string        `json:"host"`
	IPversion   int           `json:"ipversion"` // valid:"equal(0|4|6)"
	PayloadSize int           `json:"payloadsize" valid:"nonnegative"`
	Count       int           `json:"count" valid:"nonnegative"`
	Interval    time.Duration `json:"interval" valid:"nonnegative"`
}

Probe struct. Json and yaml descriptor are used for json output

func (*Probe) GenerateTStepName

func (p *Probe) GenerateTStepName() string

GetDefaultAssertions return default assertions for this executor Optional

func (Probe) GetDefaultAssertions() teststruct.StepAssertions {
	return teststruct.StepAssertions{Assertions: []string{"result.code == Success"}}
}

GenerateTStepName return a tstep name if non existent

func (Probe) GetDefaultFrequency added in v0.6.0

func (Probe) GetDefaultFrequency() time.Duration

func (Probe) GetDefaultTimeout added in v0.6.0

func (Probe) GetDefaultTimeout() time.Duration

func (Probe) GetName

func (Probe) GetName() string

Return Probe Name

func (*Probe) Initialize

func (p *Probe) Initialize(step probe.StepProbe) error

Initialize Probe struct data

func (*Probe) Run

func (p *Probe) Run(timeout time.Duration) (probeReturns []probe.ProbeReturn)

type ProbeAnswer

type ProbeAnswer struct {
	ProbeInfo probe.ProbeInfo `json:"probeinfo"`

	Reacheable  string        `json:"reacheable"`
	MinRtt      time.Duration `json:"minrtt"`
	MaxRtt      time.Duration `json:"maxrtt"`
	AvgRtt      time.Duration `json:"avgrtt"`
	Rtt         time.Duration `json:"rtt"`
	PacketLoss  float64       `json:"packetloss"`
	PacketsRecv int           `json:"packetsrecv"`
	PacketsSent int           `json:"packetssent"`
	IPAddr      string        `json:"ipaddr"`
}

ResultStatus represents a step result. Json and yaml descriptor are used for json output

Jump to

Keyboard shortcuts

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