Documentation ¶
Index ¶
- func DropFile(machines []platform.Machine, localPath string) error
- func DropLabeledFile(machines []platform.Machine, localPath, selabel string) error
- type TestCluster
- func (t *TestCluster) AssertCmdOutputContains(m platform.Machine, cmd string, expected string)
- func (t *TestCluster) AssertCmdOutputMatches(m platform.Machine, cmd string, expected *regexp.Regexp)
- func (t *TestCluster) JournalLog(m platform.Machine, f string, args ...interface{}) []byte
- func (t *TestCluster) ListNativeFunctions() []string
- func (t *TestCluster) LogJournal(m platform.Machine, msg string)
- func (t *TestCluster) LogJournalf(m platform.Machine, f string, args ...interface{})
- func (t *TestCluster) MustSSH(m platform.Machine, cmd string) []byte
- func (t *TestCluster) MustSSHf(m platform.Machine, f string, args ...interface{}) []byte
- func (t *TestCluster) Run(name string, f func(c TestCluster)) bool
- func (t *TestCluster) RunCmdSync(m platform.Machine, cmd string)
- func (t *TestCluster) RunCmdSyncf(m platform.Machine, f string, args ...interface{})
- func (t *TestCluster) RunLogged(name string, f func(c TestCluster)) bool
- func (t *TestCluster) RunNative(funcName string, m platform.Machine) bool
- func (t *TestCluster) SSH(m platform.Machine, cmd string) ([]byte, error)
- func (t *TestCluster) SSHf(m platform.Machine, f string, args ...interface{}) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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