remote

package
v1.7.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHostnameIp

func AddHostnameIp(hostname, ip string)

func CreateTestArchive

func CreateTestArchive(suite TestSuite) (string, error)

func GetHostnameOrIp

func GetHostnameOrIp(hostname string) string

GetHostnameOrIp converts hostname into ip and apply user if necessary.

func RunRemote

func RunRemote(suite TestSuite, archive string, host string, cleanup bool, junitFilePrefix string, testArgs string, ginkgoArgs string) (string, bool, error)

Returns the command output, whether the exit was ok, and any errors TODO(random-liu): junitFilePrefix is not prefix actually, the file name is junit-junitFilePrefix.xml. Change the variable name.

func SSH added in v1.5.0

func SSH(host string, cmd ...string) (string, error)

SSH executes ssh command with runSSHCommand as root. The `sudo` makes sure that all commands are executed by root, so that there won't be permission mismatch between different commands.

func SSHNoSudo added in v1.5.0

func SSHNoSudo(host string, cmd ...string) (string, error)

SSHNoSudo executes ssh command with runSSHCommand as normal user. Sometimes we need this, for example creating a directory that we'll copy files there with scp.

func WriteLog added in v1.6.0

func WriteLog(host, filename, content string) error

WriteLog is a temporary function to make it possible to write log in the runner. This is used to collect serial console log. TODO(random-liu): Use the log-dump script in cluster e2e.

Types

type ConformanceRemote added in v1.6.0

type ConformanceRemote struct{}

ConformanceRemote contains the specific functions in the node conformance test suite.

func (*ConformanceRemote) RunTest added in v1.6.0

func (c *ConformanceRemote) RunTest(host, workspace, results, junitFilePrefix, testArgs, _ string, timeout time.Duration) (string, error)

RunTest runs test on the node.

func (*ConformanceRemote) SetupTestPackage added in v1.6.0

func (c *ConformanceRemote) SetupTestPackage(tardir string) error

SetupTestPackage sets up the test package with binaries k8s required for node conformance test

type NodeE2ERemote added in v1.6.0

type NodeE2ERemote struct{}

NodeE2ERemote contains the specific functions in the node e2e test suite.

func (*NodeE2ERemote) RunTest added in v1.6.0

func (n *NodeE2ERemote) RunTest(host, workspace, results, junitFilePrefix, testArgs, ginkgoArgs string, timeout time.Duration) (string, error)

RunTest runs test on the node.

func (*NodeE2ERemote) SetupTestPackage added in v1.6.0

func (n *NodeE2ERemote) SetupTestPackage(tardir string) error

SetupTestPackage sets up the test package with binaries k8s required for node e2e tests

type TestSuite added in v1.6.0

type TestSuite interface {
	// SetupTestPackage setup the test package in the given directory. TestSuite
	// should put all necessary binaries and dependencies into the path. The caller
	// will:
	// * create a tarball with the directory.
	// * deploy the tarball to the testing host.
	// * untar the tarball to the testing workspace on the testing host.
	SetupTestPackage(path string) error
	// RunTest runs test on the node in the given workspace and returns test output
	// and test error if there is any.
	// * host is the target node to run the test.
	// * workspace is the directory on the testing host the test is running in. Note
	// that the test package is unpacked in the workspace before running the test.
	// * results is the directory the test should write result into. All logs should be
	// saved as *.log, all junit file should start with junit*.
	// * junitFilePrefix is the prefix of output junit file.
	// * testArgs is the arguments passed to test.
	// * ginkgoArgs is the arguments passed to ginkgo.
	// * timeout is the test timeout.
	RunTest(host, workspace, results, junitFilePrefix, testArgs, ginkgoArgs string, timeout time.Duration) (string, error)
}

TestSuite is the interface of a test suite, such as node e2e, node conformance, node soaking, cri validation etc.

func InitConformanceRemote added in v1.6.0

func InitConformanceRemote() TestSuite

func InitNodeE2ERemote added in v1.6.0

func InitNodeE2ERemote() TestSuite

Jump to

Keyboard shortcuts

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