container

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package container provides functionality to test pod and container level checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pod

type Pod struct {

	// Command, Is the command that is executed on the test subject
	Command string
	// Name, is the name of the test subject,e.g. CNF name
	Name string
	// Namespace, is the name of the namespace the CNF is deployed
	Namespace string
	// ExpectStatus, Is the is list of  expected output from the command
	ExpectStatus []string
	// Action, Specifies the action to ba taken on the return result
	Action testcases.TestAction
	// ResultType, Informs the type of result expected
	ResultType testcases.TestResultType
	// contains filtered or unexported fields
}

Pod that is under test.

func NewPod

func NewPod(args []string, name, namespace string, expectedStatus []string, resultType testcases.TestResultType, action testcases.TestAction, timeout time.Duration) *Pod

NewPod creates a `Container` test on the configured test cases.

func (*Pod) Args

func (p *Pod) Args() []string

Args returns the command line args for the test.

func (*Pod) Facts

func (p *Pod) Facts() string

Facts collects facts of the container

func (*Pod) GetIdentifier

func (p *Pod) GetIdentifier() identifier.Identifier

GetIdentifier returns the tnf.Test specific identifier.

func (*Pod) ReelEOF

func (p *Pod) ReelEOF()

ReelEOF does nothing.

func (*Pod) ReelFirst

func (p *Pod) ReelFirst() *reel.Step

ReelFirst returns a step which expects an pod status for the given pod.

func (*Pod) ReelMatch

func (p *Pod) ReelMatch(_, _, match string) *reel.Step

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

func (*Pod) ReelTimeout

func (p *Pod) ReelTimeout() *reel.Step

ReelTimeout does nothing;

func (*Pod) Result

func (p *Pod) Result() int

Result returns the test result.

func (*Pod) Timeout

func (p *Pod) 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