util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logf added in v0.32.0

func Logf(str string, args ...interface{})

Logf writes logs to stdout if -v is set.

func Retry added in v0.22.0

func Retry(t *testing.T, callback func() error, d time.Duration, attempts int) (err error)

Retry tries the callback for a number of attempts, with a delay between attempts

func WaitForBusyboxRunning added in v0.22.0

func WaitForBusyboxRunning(t *testing.T, namespace string) error

WaitForBusyboxRunning waits until busybox pod to be running

func WaitForFailedCreatePodSandBoxEvent added in v0.31.0

func WaitForFailedCreatePodSandBoxEvent() error

WaitForFailedCreatePodSandBoxEvent waits for a FailedCreatePodSandBox event to appear

func WaitForGvisorControllerDeleted added in v0.31.0

func WaitForGvisorControllerDeleted() error

WaitForGvisorControllerDeleted waits for the gvisor controller pod to be deleted

func WaitForGvisorControllerRunning added in v0.31.0

func WaitForGvisorControllerRunning(t *testing.T) error

WaitForGvisorControllerRunning waits for the gvisor controller pod to be running

func WaitForIngressControllerRunning added in v0.25.0

func WaitForIngressControllerRunning(t *testing.T) error

WaitForIngressControllerRunning waits until ingress controller pod to be running

func WaitForIngressDefaultBackendRunning added in v0.25.0

func WaitForIngressDefaultBackendRunning(t *testing.T) error

WaitForIngressDefaultBackendRunning waits until ingress default backend pod to be running

func WaitForNginxRunning added in v0.25.0

func WaitForNginxRunning(t *testing.T) error

WaitForNginxRunning waits for nginx service to be up

func WaitForUntrustedNginxRunning added in v0.31.0

func WaitForUntrustedNginxRunning() error

WaitForUntrustedNginxRunning waits for the untrusted nginx pod to start running

Types

type KubectlRunner

type KubectlRunner struct {
	T          *testing.T
	BinaryPath string
}

KubectlRunner runs a command using kubectl

func NewKubectlRunner

func NewKubectlRunner(t *testing.T) *KubectlRunner

NewKubectlRunner creates a new KubectlRunner

func (*KubectlRunner) CreateRandomNamespace

func (k *KubectlRunner) CreateRandomNamespace() string

CreateRandomNamespace creates a random namespace

func (*KubectlRunner) DeleteNamespace

func (k *KubectlRunner) DeleteNamespace(namespace string) error

DeleteNamespace deletes the namespace

func (*KubectlRunner) RunCommand

func (k *KubectlRunner) RunCommand(args []string) (stdout []byte, err error)

RunCommand runs a command, returning stdout

func (*KubectlRunner) RunCommandParseOutput

func (k *KubectlRunner) RunCommandParseOutput(args []string, outputObj interface{}) error

RunCommandParseOutput runs a command and parses the JSON output

type MinikubeRunner

type MinikubeRunner struct {
	T          *testing.T
	BinaryPath string
	Args       string
	StartArgs  string
	MountArgs  string
	Runtime    string
}

MinikubeRunner runs a command

func (*MinikubeRunner) CheckStatus

func (m *MinikubeRunner) CheckStatus(desired string)

CheckStatus makes sure the service has the desired status, or cause fatal error

func (*MinikubeRunner) CheckStatusNoFail added in v0.17.0

func (m *MinikubeRunner) CheckStatusNoFail(desired string) error

CheckStatusNoFail makes sure the service has the desired status, returning error

func (*MinikubeRunner) CombinedOutput added in v0.22.0

func (m *MinikubeRunner) CombinedOutput(cmd string) (string, error)

CombinedOutput executes a command, returning the combined stdout and stderr

func (*MinikubeRunner) Copy added in v0.22.0

Copy copies a file

func (*MinikubeRunner) EnsureRunning

func (m *MinikubeRunner) EnsureRunning()

EnsureRunning makes sure the container runtime is running

func (*MinikubeRunner) GetLogs added in v0.22.2

func (m *MinikubeRunner) GetLogs() string

GetLogs returns the logs of a service

func (*MinikubeRunner) GetStatus

func (m *MinikubeRunner) GetStatus() string

GetStatus returns the status of a service

func (*MinikubeRunner) ParseEnvCmdOutput added in v0.31.0

func (m *MinikubeRunner) ParseEnvCmdOutput(out string) map[string]string

ParseEnvCmdOutput parses the output of `env` (assumes bash)

func (*MinikubeRunner) Remove added in v0.22.0

func (m *MinikubeRunner) Remove(f assets.CopyableFile) error

Remove removes a file

func (*MinikubeRunner) Run added in v0.22.0

func (m *MinikubeRunner) Run(cmd string) error

Run executes a command

func (*MinikubeRunner) RunCommand

func (m *MinikubeRunner) RunCommand(command string, checkError bool) string

RunCommand executes a command, optionally checking for error

func (*MinikubeRunner) RunDaemon added in v0.18.0

func (m *MinikubeRunner) RunDaemon(command string) (*exec.Cmd, *bufio.Reader)

RunDaemon executes a command, returning the stdout

func (*MinikubeRunner) RunDaemon2 added in v0.34.0

func (m *MinikubeRunner) RunDaemon2(command string) (*exec.Cmd, *bufio.Reader, *bufio.Reader)

RunDaemon2 executes a command, returning the stdout and stderr

func (*MinikubeRunner) RunWithContext added in v0.31.0

func (m *MinikubeRunner) RunWithContext(ctx context.Context, command string) (string, string, error)

RunWithContext calls the minikube command with a context, useful for timeouts.

func (*MinikubeRunner) SSH

func (m *MinikubeRunner) SSH(command string) (string, error)

SSH returns the output of running a command using SSH

func (*MinikubeRunner) Start

func (m *MinikubeRunner) Start(opts ...string)

Start starts the container runtime

Jump to

Keyboard shortcuts

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