kubernetes: k8s.io/kubernetes/test/e2e_node/remote Index | Files

package remote

import "k8s.io/kubernetes/test/e2e_node/remote"

Package remote contains implementations of the TestSuite interface, which specify how to run various node test suites remotely.

Index

Package Files

cadvisor_e2e.go node_conformance.go node_e2e.go remote.go ssh.go types.go utils.go

func AddHostnameIp Uses

func AddHostnameIp(hostname, ip string)

func CreateTestArchive Uses

func CreateTestArchive(suite TestSuite, systemSpecName string) (string, error)

func GetHostnameOrIp Uses

func GetHostnameOrIp(hostname string) string

GetHostnameOrIp converts hostname into ip and apply user if necessary.

func GetTimestampFromWorkspaceDir Uses

func GetTimestampFromWorkspaceDir(dir string) string

Parses the workspace directory name and gets the timestamp part of it. This can later be used to name other artifacts (such as the kubelet-${instance}.service systemd transient service used to launch Kubelet) so that they can be matched to each other.

func RunRemote Uses

func RunRemote(suite TestSuite, archive string, host string, cleanup bool, imageDesc, junitFilePrefix string, testArgs string, ginkgoArgs string, systemSpecName string, extraEnvs 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 Uses

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 Uses

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 Uses

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.

type CAdvisorE2ERemote Uses

type CAdvisorE2ERemote struct{}

CAdvisorE2ERemote contains the specific functions in the cadvisor e2e test suite.

func (*CAdvisorE2ERemote) RunTest Uses

func (n *CAdvisorE2ERemote) RunTest(host, workspace, results, imageDesc, junitFilePrefix, testArgs, ginkgoArgs, systemSpecName, extraEnvs string, timeout time.Duration) (string, error)

RunTest implements TestSuite.RunTest

func (*CAdvisorE2ERemote) SetupTestPackage Uses

func (n *CAdvisorE2ERemote) SetupTestPackage(tardir, systemSpecName string) error

SetupTestPackage implements TestSuite.SetupTestPackage

type ConformanceRemote Uses

type ConformanceRemote struct{}

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

func (*ConformanceRemote) RunTest Uses

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

RunTest runs test on the node.

func (*ConformanceRemote) SetupTestPackage Uses

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

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

type NodeE2ERemote Uses

type NodeE2ERemote struct{}

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

func (*NodeE2ERemote) RunTest Uses

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

RunTest runs test on the node.

func (*NodeE2ERemote) SetupTestPackage Uses

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

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

type TestSuite Uses

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, systemSpecName 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*.
    // * imageDesc is the description of the image the test is running on.
    //   It will be used for logging purpose only.
    // * junitFilePrefix is the prefix of output junit file.
    // * testArgs is the arguments passed to test.
    // * ginkgoArgs is the arguments passed to ginkgo.
    // * systemSpecName is the name of the system spec used for validating the
    //   image on which the test runs.
    // * extraEnvs is the extra environment variables needed for node e2e tests.
    // * timeout is the test timeout.
    RunTest(host, workspace, results, imageDesc, junitFilePrefix, testArgs, ginkgoArgs, systemSpecName, extraEnvs 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 InitCAdvisorE2ERemote Uses

func InitCAdvisorE2ERemote() TestSuite

InitCAdvisorE2ERemote performs initialization for cadvisor remote testing

func InitConformanceRemote Uses

func InitConformanceRemote() TestSuite

func InitNodeE2ERemote Uses

func InitNodeE2ERemote() TestSuite

Package remote imports 17 packages (graph) and is imported by 16 packages. Updated 2019-09-24. Refresh now. Tools for package owners.