output

package
v1.30.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// Poll is how often to Poll pods, nodes and claims.
	Poll = 2 * time.Second
)

DEPRECATED constants. Use the timeouts in framework.Framework instead.

Variables

This section is empty.

Functions

func CreateEmptyFileOnPod

func CreateEmptyFileOnPod(namespace string, podName string, filePath string) error

CreateEmptyFileOnPod creates empty file at given path on the pod.

func DumpDebugInfo

func DumpDebugInfo(ctx context.Context, c clientset.Interface, ns string)

DumpDebugInfo dumps debug info of tests.

func LookForStringInLog

func LookForStringInLog(ns, podName, container, expectedString string, timeout time.Duration) (result string, err error)

LookForStringInLog looks for the given string in the log of a specific pod container

func LookForStringInLogWithoutKubectl added in v1.27.0

func LookForStringInLogWithoutKubectl(ctx context.Context, client clientset.Interface, ns string, podName string, container string, expectedString string, timeout time.Duration) (result string, err error)

LookForStringInLogWithoutKubectl looks for the given string in the log of a specific pod container

func LookForStringInPodExec

func LookForStringInPodExec(ns, podName string, command []string, expectedString string, timeout time.Duration) (result string, err error)

LookForStringInPodExec looks for the given string in the output of a command executed in the first container of specified pod.

func LookForStringInPodExecToContainer

func LookForStringInPodExecToContainer(ns, podName, containerName string, command []string, expectedString string, timeout time.Duration) (result string, err error)

LookForStringInPodExecToContainer looks for the given string in the output of a command executed in specified pod container, or first container if not specified.

func MatchContainerOutput

func MatchContainerOutput(
	ctx context.Context,
	f *framework.Framework,
	pod *v1.Pod,
	containerName string,
	expectedOutput []string,
	matcher func(string, ...interface{}) gomegatypes.GomegaMatcher) error

MatchContainerOutput creates a pod and waits for all it's containers to exit with success. It then tests that the matcher with each expectedOutput matches the output of the specified container.

func RunHostCmd

func RunHostCmd(ns, name, cmd string) (string, error)

RunHostCmd runs the given cmd in the context of the given pod using `kubectl exec` inside of a shell.

func RunHostCmdOrDie

func RunHostCmdOrDie(ns, name, cmd string) string

RunHostCmdOrDie calls RunHostCmd and dies on error.

func RunHostCmdWithFullOutput

func RunHostCmdWithFullOutput(ns, name, cmd string) (string, string, error)

RunHostCmdWithFullOutput runs the given cmd in the context of the given pod using `kubectl exec` inside of a shell. It will also return the command's stderr.

func RunHostCmdWithRetries

func RunHostCmdWithRetries(ns, name, cmd string, interval, timeout time.Duration) (string, error)

RunHostCmdWithRetries calls RunHostCmd and retries all errors until it succeeds or the specified timeout expires. This can be used with idempotent commands to deflake transient Node issues.

func TestContainerOutput

func TestContainerOutput(ctx context.Context, f *framework.Framework, scenarioName string, pod *v1.Pod, containerIndex int, expectedOutput []string)

TestContainerOutput runs the given pod in the given namespace and waits for all of the containers in the podSpec to move into the 'Success' status, and tests the specified container log against the given expected output using a substring matcher.

func TestContainerOutputMatcher

func TestContainerOutputMatcher(ctx context.Context, f *framework.Framework,
	scenarioName string,
	pod *v1.Pod,
	containerIndex int,
	expectedOutput []string,
	matcher func(string, ...interface{}) gomegatypes.GomegaMatcher)

TestContainerOutputMatcher runs the given pod in the given namespace and waits for all of the containers in the podSpec to move into the 'Success' status, and tests the specified container log against the given expected output using the given matcher.

func TestContainerOutputRegexp

func TestContainerOutputRegexp(ctx context.Context, f *framework.Framework, scenarioName string, pod *v1.Pod, containerIndex int, expectedOutput []string)

TestContainerOutputRegexp runs the given pod in the given namespace and waits for all of the containers in the podSpec to move into the 'Success' status, and tests the specified container log against the given expected output using a regexp matcher.

Types

This section is empty.

Jump to

Keyboard shortcuts

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