testutils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHNCPath

func CheckHNCPath()

CheckHNCPath skips the test if we are not able to successfully call RecoverHNC

func CleanupTestCRDIfExists

func CleanupTestCRDIfExists()

CleanupCRDIfExists checks whether the eetests.e2e.hnc.x-k8s.io CRD is present, if so, delete it.

func CleanupTestNamespaces

func CleanupTestNamespaces()

CleanupTestNamespaces finds the list of namespaces labeled as test namespaces and delegates to cleanupNamespaces function.

func CleanupTestResourceSyncMode added in v1.1.0

func CleanupTestResourceSyncMode()

CleanupTestResourceSyncMode changes the synchronization mode of resources used in testing back to its default value

func CreateNamespace

func CreateNamespace(ns string)

CreateNamespace creates the specified namespace with canned testing labels making it easier to look up and delete later.

func CreateSubnamespace

func CreateSubnamespace(ns string, parent string)

CreateSubnamespace creates the specified namespace in the parent namespace with canned testing labels making it easier to look up and delete later.

func FieldShouldContain

func FieldShouldContain(resource, ns, nm, field, want string)

func FieldShouldContainMultiple

func FieldShouldContainMultiple(resource, ns, nm, field string, want []string)

func FieldShouldContainMultipleWithTimeout

func FieldShouldContainMultipleWithTimeout(resource, ns, nm, field string, want []string, timeout float64)

func FieldShouldContainWithTimeout

func FieldShouldContainWithTimeout(resource, ns, nm, field, want string, timeout float64)

func FieldShouldNotContain

func FieldShouldNotContain(resource, ns, nm, field, want string)

func FieldShouldNotContainMultiple

func FieldShouldNotContainMultiple(resource, ns, nm, field string, want []string)

func FieldShouldNotContainMultipleWithTimeout

func FieldShouldNotContainMultipleWithTimeout(resource, ns, nm, field string, want []string, timeout float64)

func FieldShouldNotContainWithTimeout

func FieldShouldNotContainWithTimeout(resource, ns, nm, field, want string, timeout float64)

func HasHNCPath

func HasHNCPath() bool

HasHNCPath returns true if we'll be able to successfully call RecoverHNC, and false otherwise.

func MustApplyYAML

func MustApplyYAML(s string)

func MustNotApplyYAML

func MustNotApplyYAML(s string)

func MustNotRun

func MustNotRun(cmdln ...string)

func MustRun

func MustRun(cmdln ...string)

func MustRunWithTimeout

func MustRunWithTimeout(timeout float64, cmdln ...string)

func RecoverHNC

func RecoverHNC()

RecoverHNC assumes that HNC has been damaged in some way and repairs by re-applying its manifest and then waiting until very basic functionality is working again.

func RunCommand

func RunCommand(cmdln ...string) (string, error)

RunCommand passes all arguments to the OS to execute, and returns the combined stdout/stderr and and error object. By default, each arg to this function may contain strings (e.g. "echo hello world"), in which case we split the strings on the spaces (so this would be equivalent to calling "echo", "hello", "world"). If you _actually_ need an OS argument with strings in it, pass it as an argument to this function surrounded by double quotes (e.g. "echo", "\"hello world\"" will be passed to the OS as two args, not three).

func RunErrorShouldContain

func RunErrorShouldContain(substr string, seconds float64, cmdln ...string)

func RunErrorShouldContainMultiple

func RunErrorShouldContainMultiple(substrs []string, seconds float64, cmdln ...string)

func RunShouldContain

func RunShouldContain(substr string, seconds float64, cmdln ...string)

func RunShouldContainMultiple

func RunShouldContainMultiple(substrs []string, seconds float64, cmdln ...string)

func RunShouldNotContain

func RunShouldNotContain(substr string, seconds float64, cmdln ...string)

func RunShouldNotContainMultiple

func RunShouldNotContainMultiple(substrs []string, seconds float64, cmdln ...string)

func TryRun

func TryRun(cmdln ...string) error

func TryRunQuietly

func TryRunQuietly(cmdln ...string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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