hostname

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package hostname provides a hostname discovery test utilizing the `hostname` Unix command.

Index

Constants

View Source
const (
	// Command is the command name for the unix "hostname" command.
	Command = dependencies.HostnameBinaryName
	// SuccessfulOutputRegex is the regular expression match for hostname output.
	SuccessfulOutputRegex = `.+`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Hostname

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

Hostname provides a hostname test implemented using command line tool "hostname".

func NewHostname

func NewHostname(timeout time.Duration) *Hostname

NewHostname creates a new `Hostname` test which runs the "hostname" command.

func (*Hostname) Args

func (h *Hostname) Args() []string

Args returns the command line args for the test.

func (*Hostname) GetHostname

func (h *Hostname) GetHostname() string

GetHostname returns the extracted hostname, if one is extracted.

func (*Hostname) GetIdentifier

func (h *Hostname) GetIdentifier() identifier.Identifier

GetIdentifier returns the tnf.Test specific identifier.

func (*Hostname) ReelEOF

func (h *Hostname) ReelEOF()

ReelEOF does nothing; hostname requires no explicit intervention for EOF.

func (*Hostname) ReelFirst

func (h *Hostname) ReelFirst() *reel.Step

ReelFirst returns a step which expects an hostname summary for the given device.

func (*Hostname) ReelMatch

func (h *Hostname) ReelMatch(_, _, match string) *reel.Step

ReelMatch parses the hostname output and set the test result on match. Returns no step; the test is complete.

func (*Hostname) ReelTimeout

func (h *Hostname) ReelTimeout() *reel.Step

ReelTimeout does nothing; hostname requires no explicit intervention for a timeout.

func (*Hostname) Result

func (h *Hostname) Result() int

Result returns the test result.

func (*Hostname) Timeout

func (h *Hostname) Timeout() time.Duration

Timeout return the timeout for the test.

Jump to

Keyboard shortcuts

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