testutil

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestHelper

type TestHelper struct {
	testutil.KubernetesHelper
	// contains filtered or unexported fields
}

TestHelper provides helpers for running the linkerd SMI integration tests.

func NewTestHelper

func NewTestHelper() *TestHelper

NewTestHelper creates a new instance of TestHelper for the current test run. The new TestHelper can be configured via command line flags.

func (*TestHelper) GetSMIHelmChart

func (h *TestHelper) GetSMIHelmChart() string

GetSMIHelmChart returns the path to the linkerd-smi Helm chart

func (*TestHelper) GetSMIHelmVersion

func (h *TestHelper) GetSMIHelmVersion() string

GetSMIHelmVersion returns the version of the linkerd-smi Helm chart

func (*TestHelper) GetSMINamespace added in v0.2.0

func (h *TestHelper) GetSMINamespace() string

GetSMINamespace returns the namespace in which linkerd-smi is installed

func (*TestHelper) GetServiceProfile

func (h *TestHelper) GetServiceProfile(ctx context.Context, namespace, name string) (*serviceprofile.ServiceProfile, error)

GetServiceProfile returns the given ServiceProfile

func (*TestHelper) HelmInstall

func (h *TestHelper) HelmInstall(chart, releaseName string, arg ...string) (string, string, error)

HelmInstall runs the helm install subcommand, with the provided arguments

func (*TestHelper) HelmRun

func (h *TestHelper) HelmRun(arg ...string) (string, string, error)

HelmRun executes a helm command appended with the --context

func (*TestHelper) IsHelm

func (h *TestHelper) IsHelm() bool

IsHelm returns true if Helm path is passed

func (*TestHelper) LinkerdRun

func (h *TestHelper) LinkerdRun(arg ...string) (string, error)

LinkerdRun executes a linkerd command returning its stdout.

func (*TestHelper) LinkerdSMIRun

func (h *TestHelper) LinkerdSMIRun(arg ...string) (string, error)

LinkerdSMIRun executes a linkerd SMI command returning its stdout.

func (*TestHelper) PipeToHelmRun

func (h *TestHelper) PipeToHelmRun(stdin string, arg ...string) (string, string, error)

PipeToHelmRun executes a Helm command appended with the --context flag, and provides a string at Stdin.

func (*TestHelper) PipeToLinkerdRun

func (h *TestHelper) PipeToLinkerdRun(stdin string, arg ...string) (string, string, error)

PipeToLinkerdRun executes a linkerd command appended with the --linkerd-namespace flag, and provides a string at Stdin.

func (*TestHelper) RetryFor

func (h *TestHelper) RetryFor(timeout time.Duration, fn func() error) error

RetryFor retries a given function every second until the function returns without an error, or a timeout is reached. If the timeout is reached, it returns the last error received from the function.

Jump to

Keyboard shortcuts

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