cluster

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropFile

func DropFile(machines []platform.Machine, localPath string) error

DropFile places file from localPath to ~/ on every machine in cluster

func DropLabeledFile

func DropLabeledFile(machines []platform.Machine, localPath, selabel string) error

DropLabeledFile places file from localPath to ~/ on every machine in cluster, potentially with a custom SELinux label.

Types

type TestCluster

type TestCluster struct {
	*harness.H
	platform.Cluster
	NativeFuncs []string

	// If set to true and a sub-test fails all future sub-tests will be skipped
	FailFast bool
	// contains filtered or unexported fields
}

TestCluster embedds a Cluster to provide platform independant helper methods.

func (*TestCluster) AssertCmdOutputContains

func (t *TestCluster) AssertCmdOutputContains(m platform.Machine, cmd string, expected string)

AssertCmdOutputContains runs cmd via SSH and panics if stdout does not contain expected

func (*TestCluster) AssertCmdOutputMatches

func (t *TestCluster) AssertCmdOutputMatches(m platform.Machine, cmd string, expected *regexp.Regexp)

AssertCmdOutputContains runs cmd via SSH and panics if stdout does not contain expected

func (*TestCluster) JournalLog

func (t *TestCluster) JournalLog(m platform.Machine, f string, args ...interface{}) []byte

func (*TestCluster) ListNativeFunctions

func (t *TestCluster) ListNativeFunctions() []string

ListNativeFunctions returns a slice of function names that can be executed directly on machines in the cluster.

func (*TestCluster) LogJournal

func (t *TestCluster) LogJournal(m platform.Machine, msg string)

Synchronously write a log message from the syslog identifier `kola` into the target machine's journal (via ssh) as well as at a debug log level to the current process. This is useful for debugging test failures, as we always capture the target system journal.

func (*TestCluster) LogJournalf

func (t *TestCluster) LogJournalf(m platform.Machine, f string, args ...interface{})

func (*TestCluster) MustSSH

func (t *TestCluster) MustSSH(m platform.Machine, cmd string) []byte

MustSSH runs a ssh command on the given machine in the cluster, writes its stderr to the test's output as a 'Log' line, fails the test if the command is unsuccessful, and returns the command's stdout.

func (*TestCluster) MustSSHf

func (t *TestCluster) MustSSHf(m platform.Machine, f string, args ...interface{}) []byte

func (*TestCluster) Run

func (t *TestCluster) Run(name string, f func(c TestCluster)) bool

Run runs f as a subtest and reports whether f succeeded.

func (*TestCluster) RunCmdSync

func (t *TestCluster) RunCmdSync(m platform.Machine, cmd string)

RunCmdSync synchronously exectues a command, logging the output to the journal

func (*TestCluster) RunCmdSyncf

func (t *TestCluster) RunCmdSyncf(m platform.Machine, f string, args ...interface{})

RunCmdSyncf is like RunCmdSync but accepts formatted arguments.

func (*TestCluster) RunLogged

func (t *TestCluster) RunLogged(name string, f func(c TestCluster)) bool

Same as Run, but logs a message in the machines' journal logs before and after running the function.

func (*TestCluster) RunNative

func (t *TestCluster) RunNative(funcName string, m platform.Machine) bool

RunNative runs a registered NativeFunc on a remote machine

func (*TestCluster) SSH

func (t *TestCluster) SSH(m platform.Machine, cmd string) ([]byte, error)

SSH runs a ssh command on the given machine in the cluster. It differs from Machine.SSH in that stderr is written to the test's output as a 'Log' line. This ensures the output will be correctly accumulated under the correct test.

func (*TestCluster) SSHf

func (t *TestCluster) SSHf(m platform.Machine, f string, args ...interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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